1
0
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:
Ryan Cramer
2016-11-03 12:18:53 -04:00
parent 29023269a4
commit 8bf7b0dc41

View File

@@ -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." ;