Skip to content

Commit 4f26e0b

Browse files
alisterdevsamirdas
authored andcommitted
Download fix (aces#2745)
1 parent a3809ae commit 4f26e0b

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

modules/media/ajax/FileDownload.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,9 @@
2020
exit;
2121
}
2222

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-
23+
// Make sure that the user isn't trying to break out of the $path
24+
// by using a relative filename.
25+
$file = basename($_GET['File']);
3226
$config =& NDB_Config::singleton();
3327
$path = $config->getSetting('mediaPath');
3428
$filePath = $path . $file;

0 commit comments

Comments
 (0)