From 8bf7b0dc4144d9f1ea1dcfdf546b208f082dd4e3 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 3 Nov 2016 12:18:53 -0400 Subject: [PATCH] Add @pine3ree PR #24 which adds a break statement to a for() loop in WireFileTools.php --- wire/core/WireFileTools.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wire/core/WireFileTools.php b/wire/core/WireFileTools.php index 72f235bc..06b12b26 100644 --- a/wire/core/WireFileTools.php +++ b/wire/core/WireFileTools.php @@ -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." ;