From 2255b9404ed2b7464c8f25ec8203840d017ff300 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Mon, 29 Sep 2014 12:59:14 +1000 Subject: [PATCH] Adds support for Windows-based paths --- modules/system/traits/ConfigMaker.php | 2 +- modules/system/traits/ViewMaker.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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))