Skip to content

Commit 3ee8580

Browse files
Merge pull request #67 from PhilippMundhenk/PhilippMundhenk-patch-1
added PHP7 support
2 parents 3706472 + 6411324 commit 3ee8580

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

html/download.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
33
if(array_key_exists("file", $_GET)) {
44
$file = $_GET["file"];
5-
if(str_contains($file, "..") || str_contains($file, "/")) {
5+
$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+
$evil=true;
13+
}
14+
}
15+
if($evil === true) {
616
header($_SERVER["SERVER_PROTOCOL"] . " 400 OK");
717
die("Error: Dont't be evil!");
818
}
@@ -20,4 +30,4 @@
2030
die("Error: No file provided!");
2131
}
2232
}
23-
?>
33+
?>

0 commit comments

Comments
 (0)