diff --git a/change_log.txt b/change_log.txt index 2c478764..05ddedce 100644 --- a/change_log.txt +++ b/change_log.txt @@ -4,6 +4,7 @@ - optimization of directory handling / build realpath - optimization of filter execution - move registerObject / registerClass into extension + - update realpath handling 19.06.2015 - improvement allow closures as callback at $smarty->registerFilter() https://github.com/smarty-php/smarty/issues/59 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index dd6c5ac8..437b4704 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.28-dev/5'; + const SMARTY_VERSION = '3.1.28-dev/6'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php index de794517..0792fbe3 100644 --- a/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -167,7 +167,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null; $_dir_sep = $smarty->use_sub_dirs ? '/' : '^'; $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0; - $_dir = realpath($smarty->getCacheDir()) . '/'; + $_dir = $smarty->getCacheDir(); if ($_dir == '/') { //We should never want to delete this! return 0; } diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index 93c90a91..cf963832 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -382,13 +382,13 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil // update template with original template resource of {block} if (trim($_attr['type'], "'") == 'file') { - $compiler->template->template_resource = 'file:' . realpath(trim($_attr['file'], "'")); + $compiler->template->template_resource = 'file:' . $compiler->template->smarty->_realpath(trim($_attr['file'], "'")); } else { $compiler->template->template_resource = trim($_attr['resource'], "'"); } // source object unset ($compiler->template->source); - $exists = $compiler->template->source->exists; + $compiler->template->loadSource(); // must merge includes if ($_attr['nocache'] == true) { diff --git a/libs/sysplugins/smarty_internal_resource_extends.php b/libs/sysplugins/smarty_internal_resource_extends.php index 16974ef2..c6bdc202 100644 --- a/libs/sysplugins/smarty_internal_resource_extends.php +++ b/libs/sysplugins/smarty_internal_resource_extends.php @@ -44,7 +44,7 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource throw new SmartyException("Resource type {$s->type} cannot be used with the extends resource type"); } $sources[$s->uid] = $s; - $uid .= realpath($s->filepath); + $uid .= $source->smarty->_realpath($s->filepath); if ($_template && $_template->smarty->compile_check) { $exists = $exists && $s->exists; }