]> git.mjollnir.org Git - moodle.git/commitdiff
Parameters fix for files.
authormoodler <moodler>
Sat, 1 May 2004 03:33:10 +0000 (03:33 +0000)
committermoodler <moodler>
Sat, 1 May 2004 03:33:10 +0000 (03:33 +0000)
This allows

   http://example.com/file.php/1/somefile.swf?a=xxx&b=xxxx

Thanks to Bernard Boucher!

file.php

index 7b02dcec9931373a73fc1ea1273ca7d9a4dc57f7..d1412f757b834cf3c6462104040669c186ab1b9d 100644 (file)
--- a/file.php
+++ b/file.php
     // it's OK to get here if no course was specified
 
     $pathname = "$CFG->dataroot$pathinfo";
+    if ($pathargs = explode("?",$pathname)) {
+        $pathname = $pathargs[0];            // Only keep what's before the '?'
+    }
     $filename = $args[$numargs-1];
+    if ($fileargs = explode("?",$filename)) {
+        $filename = $fileargs[0];            // Only keep what's before the '?'
+    }
 
     if (file_exists($pathname)) {
         $lastmodified = filemtime($pathname);