Skip to content

Commit

Permalink
better error message when we cant find file
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed May 26, 2014
1 parent 4bff689 commit 26cf68e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions include/utils/CommonUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -2838,7 +2838,11 @@ function checkFileAccessForInclusion($filepath) {
$filePathParts = explode('/', $relativeFilePath);

if (stripos($realfilepath, $rootdirpath) !== 0 || in_array($filePathParts[0], $unsafeDirectories)) {
die("Sorry! Attempt to access restricted file.");
echo "Sorry! Attempt to access restricted file.<br>";
echo "We are looking for this file path: $filepath<br>";
echo "We are looking here:<br> Real file path: $realfilepath<br>";
echo "Root dir path: $rootdirpath<br>";
die();
}
}

Expand Down Expand Up @@ -2867,7 +2871,11 @@ function checkFileAccessForDeletion($filepath) {
$filePathParts = explode('/', $relativeFilePath);

if (stripos($realfilepath, $rootdirpath) !== 0 || !in_array($filePathParts[0], $safeDirectories)) {
die("Sorry! Attempt to access restricted file.");
echo "Sorry! Attempt to access restricted file.<br>";
echo "We are looking for this file path: $filepath<br>";
echo "We are looking here:<br> Real file path: $realfilepath<br>";
echo "Root dir path: $rootdirpath<br>";
die();
}

}
Expand Down

0 comments on commit 26cf68e

Please sign in to comment.