mirror of
https://github.com/processwire/processwire.git
synced 2025-08-18 12:31:17 +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
|
// filename is absolute, make sure it's in a location we consider safe
|
||||||
$allowed = false;
|
$allowed = false;
|
||||||
foreach($options['allowedPaths'] as $path) {
|
foreach($options['allowedPaths'] as $path) {
|
||||||
if(strpos($filename, $path) === 0) $allowed = true;
|
if(strpos($filename, $path) === 0) {
|
||||||
|
$allowed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!$allowed) {
|
if(!$allowed) {
|
||||||
$error = "Filename $filename is not in an allowed path." ;
|
$error = "Filename $filename is not in an allowed path." ;
|
||||||
|
Reference in New Issue
Block a user