From 04cb4ddd2c94d9f89e9a71ae193eccbb944e6c6c Mon Sep 17 00:00:00 2001 From: Vojta Svoboda Date: Mon, 23 Oct 2017 16:48:34 +0200 Subject: [PATCH] Check if given partial name is also file or only folder (#3190) Fixes #2383. Credit to @vojtasvoboda, reviewed by @CptMeatball --- modules/system/traits/ViewMaker.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/system/traits/ViewMaker.php b/modules/system/traits/ViewMaker.php index 02b3f9b3a..cc1f80b45 100644 --- a/modules/system/traits/ViewMaker.php +++ b/modules/system/traits/ViewMaker.php @@ -78,7 +78,8 @@ trait ViewMaker */ public function makePartial($partial, $params = [], $throwException = true) { - if (!File::isPathSymbol($partial) && realpath($partial) === false) { + $notRealPath = realpath($partial) === false || is_dir($partial) === true; + if (!File::isPathSymbol($partial) && $notRealPath) { $folder = strpos($partial, '/') !== false ? dirname($partial) . '/' : ''; $partial = $folder . '_' . strtolower(basename($partial)).'.htm'; }