]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13339 - ensure we don't continue the restore process if there is
authorpoltawski <poltawski>
Thu, 7 Feb 2008 18:52:51 +0000 (18:52 +0000)
committerpoltawski <poltawski>
Thu, 7 Feb 2008 18:52:51 +0000 (18:52 +0000)
no course header in the backup file. This bug was causing blank course
records to be created when users tried to restore a non-moodle backup file
such as a scorm file.
merged from MOODLE_19_STABLE

backup/restorelib.php

index 1ba2c3297ce7762762ace16b4a0ddfbb664ba981..2c6fc076368329eaa04bfa1d6e6c839296de95c5 100644 (file)
@@ -6812,6 +6812,11 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
             $info = restore_read_xml_info ($xml_file);
             //Reading course_header from file
             $course_header = restore_read_xml_course_header ($xml_file);
+
+            if(!is_object($course_header)){
+                // ensure we fail if there is no course header
+                $course_header = false;
+            }
         }
 
         if (!defined('RESTORE_SILENTLY')) {