From d45bd055d7ad7830c9e6ae02fc3ed40cd671c143 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 1 May 2004 03:33:10 +0000 Subject: [PATCH] Parameters fix for files. This allows http://example.com/file.php/1/somefile.swf?a=xxx&b=xxxx Thanks to Bernard Boucher! --- file.php | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.39.5