]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15919 fixed scriptname param
authorskodak <skodak>
Sat, 6 Sep 2008 21:15:52 +0000 (21:15 +0000)
committerskodak <skodak>
Sat, 6 Sep 2008 21:15:52 +0000 (21:15 +0000)
draftfile.php
pluginfile.php
userfile.php

index bc1e7e50763dc13f16f5042ea274ef1cd03c1a83..8284b44c6453246f6d5fdfe74bd49a3dc0eebfd8 100644 (file)
@@ -11,7 +11,7 @@
     // disable moodle specific debug messages
     disable_debugging();
 
-    $relativepath = get_file_argument('file.php');
+    $relativepath = get_file_argument('draftfile.php');
     $forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
 
     // relative path must start with '/'
@@ -29,7 +29,7 @@
     }
 
     $contextid = (int)array_shift($args);
-    $filearea = array_shift($args);
+    $itemid    = (int)array_shift($args);
 
     $context = get_context_instance_by_id($contextid);
     if ($context->contextlevel != CONTEXT_USER) {
         print_error('invaliduserid');
     }
 
-    switch ($filearea) {
-        case 'user_draft'  : $itemid = (int)array_shift($args); break;
-        default:        send_file_not_found();
-    }
-
     $relativepath = '/'.implode('/', $args);
 
-
     $fs = get_file_storage();
 
-    $fullpath = $context->id.$filearea.$itemid.$relativepath;
+    $fullpath = $context->id.'user_draft'.$itemid.$relativepath;
 
     if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->get_filename() == '.') {
         send_file_not_found();
index ed3c18d2f2da361b5d1650acd0edd30e7848512e..06dc3cb84592312f334f41db7118a90bd83ff509 100644 (file)
@@ -6,7 +6,7 @@
     // disable moodle specific debug messages
     disable_debugging();
 
-    $relativepath = get_file_argument('file.php');
+    $relativepath = get_file_argument('pluginfile.php');
     $forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
 
     // relative path must start with '/'
index 228ad856ca829b5d1f317c04ee17be6131aa835d..3d7a68c1e97a6bf4d43964e6f10618fe66f4e4f6 100644 (file)
@@ -6,7 +6,7 @@
     // disable moodle specific debug messages
     disable_debugging();
 
-    $relativepath = get_file_argument('file.php');
+    $relativepath = get_file_argument('userfile.php');
     $forcedownload = optional_param('forcedownload', 0, PARAM_BOOL);
 
     // relative path must start with '/'