mirror of
https://github.com/processwire/processwire.git
synced 2025-08-17 20:11:46 +02:00
Add @pine3ree PR #24 which adds a break statement to a for() loop in WireFileTools.php
This commit is contained in:
@@ -535,7 +535,10 @@ class WireFileTools extends Wire {
|
||||
// filename is absolute, make sure it's in a location we consider safe
|
||||
$allowed = false;
|
||||
foreach($options['allowedPaths'] as $path) {
|
||||
if(strpos($filename, $path) === 0) $allowed = true;
|
||||
if(strpos($filename, $path) === 0) {
|
||||
$allowed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$allowed) {
|
||||
$error = "Filename $filename is not in an allowed path." ;
|
||||
|
Reference in New Issue
Block a user