From a959afc4220c115ac81923d22c173db44e175018 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 6 Feb 2025 09:04:08 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#2029 --- wire/core/WireTempDir.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wire/core/WireTempDir.php b/wire/core/WireTempDir.php index 4e9b2657..e7a1a921 100644 --- a/wire/core/WireTempDir.php +++ b/wire/core/WireTempDir.php @@ -72,6 +72,11 @@ class WireTempDir extends Wire { if(!is_null($this->tempDirRoot)) throw new WireException("Temp dir has already been created"); if(empty($name)) $name = $this->createName(); if(is_object($name)) $name = wireClassName($name, false); + + if($basePath && !$this->wire()->files->allowPath($basePath, true)) { + $this->log("Given base path $basePath is not within ProcessWire assets so has been replaced"); + $basePath = ''; + } $basePath = $this->classRootPath(true, $basePath); $this->classRoot = $basePath;