diff --git a/modules/system/traits/ConfigMaker.php b/modules/system/traits/ConfigMaker.php index acef7458d..faf5848a0 100644 --- a/modules/system/traits/ConfigMaker.php +++ b/modules/system/traits/ConfigMaker.php @@ -122,7 +122,7 @@ trait ConfigMaker $fileName = File::symbolizePath($fileName, $fileName); - if (substr($fileName, 0, 1) == '/' || realpath($fileName) !== false) + if (File::isLocalPath($fileName) || realpath($fileName) !== false) return $fileName; if (!is_array($configPath)) diff --git a/modules/system/traits/ViewMaker.php b/modules/system/traits/ViewMaker.php index 5e587c441..3a77c08d2 100644 --- a/modules/system/traits/ViewMaker.php +++ b/modules/system/traits/ViewMaker.php @@ -129,7 +129,7 @@ trait ViewMaker */ public function makeLayoutPartial($partial, $params = []) { - if (!in_array(substr($partial, 0, 1), ['/', '@'])) + if (!File::isLocalPath($partial) && !File::isPathSymbol($partial)) $partial = '_' . strtolower($partial); return $this->makeLayout($partial, $params); @@ -153,7 +153,7 @@ trait ViewMaker $fileName = File::symbolizePath($fileName, $fileName); - if (substr($fileName, 0, 1) == '/' || realpath($fileName) !== false) + if (File::isLocalPath($fileName) || realpath($fileName) !== false) return $fileName; if (!is_array($viewPath))