From: moodler Date: Sat, 1 May 2004 03:33:10 +0000 (+0000) Subject: Parameters fix for files. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d45bd055d7ad7830c9e6ae02fc3ed40cd671c143;p=moodle.git Parameters fix for files. This allows http://example.com/file.php/1/somefile.swf?a=xxx&b=xxxx Thanks to Bernard Boucher! --- diff --git a/file.php b/file.php index 7b02dcec99..d1412f757b 100644 --- a/file.php +++ b/file.php @@ -41,7 +41,13 @@ // 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);