From 09c936dba9bda7b8111a1e52aff693893547715b Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 5 Feb 2019 08:46:10 -0500 Subject: [PATCH] Attempt to fix processwire/processwire-issues#801 --- wire/core/WireFileTools.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wire/core/WireFileTools.php b/wire/core/WireFileTools.php index 968ed153..61245b0f 100644 --- a/wire/core/WireFileTools.php +++ b/wire/core/WireFileTools.php @@ -481,8 +481,9 @@ class WireFileTools extends Wire { return false; } - if(strpos($pathname, '//') !== false) { - // URLs or accidental extra slashes not allowed + $pos = strpos($pathname, '//'); + if($pos !== false && $pos !== strpos($this->wire('config')->paths->assets, '//')) { + // URLs or accidental extra slashes not allowed, unless they also appear in a known safe system path if($throw) throw new WireException('pathname may not contain double slash “//”'); return false; }