]> git.mjollnir.org Git - moodle.git/commitdiff
Merged pathname checks from stable
authormoodler <moodler>
Wed, 29 Sep 2004 06:52:24 +0000 (06:52 +0000)
committermoodler <moodler>
Wed, 29 Sep 2004 06:52:24 +0000 (06:52 +0000)
mod/quiz/export.php
mod/quiz/import.php

index 4ad463a513c0a95ee83116461de56cdb3b0ee9bc..e6ed588646d079d9c031ca6d0eb47c1ef97edb1a 100644 (file)
 
     if ($form = data_submitted()) {   /// Filename
 
+        $form->format = clean_filename($form->format);
+
         if (! is_readable("format/$form->format/format.php")) {
-            error("Format not known ($form->format)");
+            error('Format not known ('.clean_text($form->format).')');
         }
 
         require("format.php");  // Parent class
index 5701cf569bae4dd994680d3b09f80b5cdc9c6d33..393c1763534bc1d2ddba7f24cdd227d603e98a05 100644 (file)
 
         if (is_array($newfile)) { // either for file already on server or just uploaded file.
 
+            $form->format = clean_filename($form->format);
+
             if (! is_readable("format/$form->format/format.php")) {
-                error("Format not known ($form->format)");
+                error('Format not known ('.clean_text($form->format).')');
             }
 
             require("format.php");  // Parent class