Skip to content

Commit 275c8ff

Browse files
authored
Merge pull request #84 from stronk7/no_blank_paths
Avoid processing blank/empty paths
2 parents 32156ed + cceb861 commit 275c8ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@
6161
$failed = false;
6262
$fullpaths = [];
6363
foreach ($paths as $path) {
64-
$path = clean_param($path, PARAM_PATH);
64+
$path = trim(clean_param($path, PARAM_PATH));
65+
if (empty($path)) { // No blanks, we don't want to check the whole dirroot.
66+
continue;
67+
}
6568
$fullpath = $CFG->dirroot . '/' . trim($path, '/');
6669
if (!is_file($fullpath) && !is_dir($fullpath)) {
6770
echo $output->invald_path_message($path);

0 commit comments

Comments
 (0)