Skip to content

Commit 343c07c

Browse files
committed
Replace \ with / in path to check
1 parent 7fd08af commit 343c07c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/bug-files-check.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Work out the real path for a file
1616
$files[$i] = realpath($_SERVER['DOCUMENT_ROOT'].$files[$i]);
1717
// If we can't find that file or it doesn't start with the doc root, it's an error
18-
if (!file_exists($files[$i]) || strpos($files[$i],$_SERVER['DOCUMENT_ROOT']) !== 0) {
18+
if (!file_exists($files[$i]) || strpos(str_replace("\\","/",$files[$i]),$_SERVER['DOCUMENT_ROOT']) !== 0) {
1919
$result = "error";
2020
} else {
2121
$filesSizesSeen[$i] = filesize($files[$i]);

lib/download.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Establish the real absolute path to the file
66
$file = realpath($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['file'])));
77
// If it doesn't exist, or doesn't start with the $docRoot, stop here
8-
if (!file_exists($file) || strpos($file,$docRoot) !== 0) {
8+
if (!file_exists($file) || strpos(str_replace("\\","/",$file),$docRoot) !== 0) {
99
die("<script>alert('Sorry, that file doesn\'t appear to exist');</script>");
1010
}
1111

0 commit comments

Comments
 (0)