We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3809ae commit 4f26e0bCopy full SHA for 4f26e0b
1 file changed
modules/media/ajax/FileDownload.php
@@ -20,15 +20,9 @@
20
exit;
21
}
22
23
-// Make sure that the user isn't trying to break out of the $path by using a relative
24
-// filename. No need to check for '/' since all downloads are relative to $basePath.
25
-$file = $_GET['File'];
26
-if (strpos("..", $file) !== false) {
27
- error_log("ERROR: Invalid filename");
28
- header("HTTP/1.1 400 Bad Request");
29
- exit(4);
30
-}
31
-
+// Make sure that the user isn't trying to break out of the $path
+// by using a relative filename.
+$file = basename($_GET['File']);
32
$config =& NDB_Config::singleton();
33
$path = $config->getSetting('mediaPath');
34
$filePath = $path . $file;
0 commit comments