From b1551a687d99fee6714f649b28a64e10bd05caeb Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Fri, 21 Jun 2019 09:40:18 +0100 Subject: [PATCH] Catch Path::join() exceptions in findTemplate() (fixes #9084) --- src/View/ThemeResourceLoader.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/View/ThemeResourceLoader.php b/src/View/ThemeResourceLoader.php index 60945e5f2..303b28854 100644 --- a/src/View/ThemeResourceLoader.php +++ b/src/View/ThemeResourceLoader.php @@ -218,9 +218,13 @@ class ThemeResourceLoader foreach ($themePaths as $themePath) { // Join path $pathParts = [ $this->base, $themePath, 'templates', $head, $type, $tail ]; - $path = Path::join($pathParts) . '.ss'; - if (file_exists($path)) { - return $path; + try { + $path = Path::join($pathParts) . '.ss'; + if (file_exists($path)) { + return $path; + } + } catch (InvalidArgumentException $e) { + // No-op } } }