From 78243be722832ead4ef20ee7c67a661e0d0fb987 Mon Sep 17 00:00:00 2001 From: uwetews Date: Sun, 20 Dec 2015 16:21:32 +0100 Subject: [PATCH] - bugfix add addition check for OS type on normalization of file path https://github.com/smarty-php/smarty/issues/134 --- change_log.txt | 1 + libs/Smarty.class.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/change_log.txt b/change_log.txt index 488945c1..08c83c3b 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,7 @@ 20.12.2015 - bugfix failure when the default resource type was set to 'extendsall' https://github.com/smarty-php/smarty/issues/123 - update compilation of Smarty special variables + - bugfix add addition check for OS type on normalizaition of file path https://github.com/smarty-php/smarty/issues/134 19.12.2015 - bugfix using $smarty.capture.foo in expressions could fail https://github.com/smarty-php/smarty/pull/138 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 7ae0c75d..2e173df6 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -118,7 +118,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.29-dev/15'; + const SMARTY_VERSION = '3.1.29-dev/16'; /** * define variable scopes @@ -1178,7 +1178,7 @@ class Smarty extends Smarty_Internal_TemplateBase $path = str_replace($nds, DS, $path); } - if ($realpath === true && $path[0] !== '/' && $path[1] !== ':') { + if ($realpath === true && (($path[0] !== '/' && DS == '/') || ($path[1] !== ':' && DS != '/'))) { $path = getcwd() . DS . $path; } while ((strpos($path, '.' . DS) !== false) || (strpos($path, DS . DS) !== false)) {