Skip to content

Error accessing export_scorm.php #55

@1katoda

Description

@1katoda

We had an issue while accessing export_scorm.php file, where the server would return a 503 error on request, but no exceptions were logged in php-fpm logs. We use Moodle 4.5 with 4.6.7 version of the plugin.

In the file there is a class, which is apparently only used once and only for a method that creates a temporary file:

class block_exacomp_ZipArchive extends \ZipArchive {
    /**
     * @return ZipArchive
     */
    public static function create_temp_file() {
        global $CFG;
        $file = tempname($CFG->tempdir, "zip");
        $zip = new \ZipArchive();
        $zip->open($file, ZipArchive::OVERWRITE);
        return $zip;
    }
}

global $zip, $existingfilesarray;
$zip = block_exacomp_ZipArchive::create_temp_file();

Removing this class fixes the issue and makes the code more concise:

global $zip, $existingfilesarray;
$file = tempnam($CFG->tempdir, "zip");
$zip = new ZipArchive();
$zip->open($file, ZipArchive::OVERWRITE);
$existingfilesarray = array();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions