mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Catch Path::join() exceptions in findTemplate() (fixes #9084)
This commit is contained in:
parent
a54ba97e16
commit
b1551a687d
@ -218,10 +218,14 @@ class ThemeResourceLoader
|
|||||||
foreach ($themePaths as $themePath) {
|
foreach ($themePaths as $themePath) {
|
||||||
// Join path
|
// Join path
|
||||||
$pathParts = [ $this->base, $themePath, 'templates', $head, $type, $tail ];
|
$pathParts = [ $this->base, $themePath, 'templates', $head, $type, $tail ];
|
||||||
|
try {
|
||||||
$path = Path::join($pathParts) . '.ss';
|
$path = Path::join($pathParts) . '.ss';
|
||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
} catch (InvalidArgumentException $e) {
|
||||||
|
// No-op
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user