MDL-36453 - mod_data: Presets now load in a Windows environment.
authorAdrian Greeve <adrian@moodle.com>
Thu, 8 Nov 2012 09:38:57 +0000 (17:38 +0800)
committerAdrian Greeve <adrian@moodle.com>
Thu, 15 Nov 2012 00:51:42 +0000 (08:51 +0800)
Thanks to Michael de Raadt for this patch.

mod/data/preset.php

index bd31428..e36af7b 100644 (file)
@@ -216,7 +216,7 @@ if (optional_param('sesskey', false, PARAM_BOOL) && confirm_sesskey()) {
         } else if ($action == 'finishimport') {
             $overwritesettings = optional_param('overwritesettings', false, PARAM_BOOL);
             if (!$fullname) {
-                $presetdir = $CFG->tempdir.'/forms/'.required_param('directory', PARAM_ALPHANUMEXT);
+                $presetdir = $CFG->tempdir.'/forms/'.required_param('directory', PARAM_FILE);
                 if (!file_exists($presetdir) || !is_dir($presetdir)) {
                     print_error('cannotimport');
                 }