We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3706472 + 6411324 commit 3ee8580Copy full SHA for 3ee8580
html/download.php
@@ -2,7 +2,17 @@
2
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
3
if(array_key_exists("file", $_GET)) {
4
$file = $_GET["file"];
5
- if(str_contains($file, "..") || str_contains($file, "/")) {
+ $evil = false;
6
+ if (!function_exists('str_contains')) {
7
+ if(strpos($file, "..") !== false || strpos($file, "/") !== false) {
8
+ $evil=true;
9
+ }
10
+ } else {
11
+ if(str_contains($file, "..") || str_contains($file, "/")) {
12
13
14
15
+ if($evil === true) {
16
header($_SERVER["SERVER_PROTOCOL"] . " 400 OK");
17
die("Error: Dont't be evil!");
18
}
@@ -20,4 +30,4 @@
20
30
die("Error: No file provided!");
21
31
22
32
23
-?>
33
+?>
0 commit comments