diff --git a/change_log.txt b/change_log.txt index ffd6368f..5a81e84c 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ -===== 3.1.33-dev-1 ===== +===== 3.1.33-dev-2 ===== +17.05.2018 + - bugfix plugins may not be loaded when setMergeCompiledIncludes is true https://github.com/smarty-php/smarty/issues/435 + 26.04.2018 - bugfix regarding Security Vulnerability did not solve the problem under Linux. diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index bdeffb16..f9737b28 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.33-dev-1'; + const SMARTY_VERSION = '3.1.33-dev-2'; /** * define variable scopes */ @@ -1011,7 +1011,7 @@ class Smarty extends Smarty_Internal_TemplateBase Smarty_Internal_Template $template = null) { $template_name = (strpos($template_name, ':') === false) ? "{$this->default_resource_type}:{$template_name}" : - $template_name; + $template_name; $cache_id = $cache_id === null ? $this->cache_id : $cache_id; $compile_id = $compile_id === null ? $this->compile_id : $compile_id; $caching = (int)($caching === null ? $this->caching : $caching); @@ -1044,7 +1044,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $nds = array('/' => '\\', '\\' => '/'); // normalize DIRECTORY_SEPARATOR - $path = str_replace(array($nds[DIRECTORY_SEPARATOR], DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, $path); + //$path = str_replace(array($nds[DIRECTORY_SEPARATOR], DIRECTORY_SEPARATOR . '.' . DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, $path); preg_match('%^(?(?:[[:alpha:]]:[\\\\]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?(.*))$%u', $path, $parts); diff --git a/libs/sysplugins/smarty_internal_runtime_codeframe.php b/libs/sysplugins/smarty_internal_runtime_codeframe.php index f792496f..80a50eb8 100644 --- a/libs/sysplugins/smarty_internal_runtime_codeframe.php +++ b/libs/sysplugins/smarty_internal_runtime_codeframe.php @@ -58,10 +58,6 @@ class Smarty_Internal_Runtime_CodeFrame var_export($_template->smarty->ext->_tplFunction->getTplFunction($_template), true) . ");\n"; } - // include code for required plugins - if (!$cache && isset($compiler)) { - $output .= $compiler->compileRequiredPlugins(); - } $output .= "?>"; $output .= $content; $output .= ""; diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 0d7284a0..be3647bd 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -421,6 +421,9 @@ abstract class Smarty_Internal_TemplateCompilerBase $_content = $this->template->source->getContent(); } $_compiled_code = $this->postFilter($this->doCompile($this->preFilter($_content), true)); + if (!empty($this->required_plugins[ 'compiled' ]) || !empty($this->required_plugins[ 'nocache' ])) { + $_compiled_code = 'compileRequiredPlugins() . "?>\n" . $_compiled_code; + } } catch (Exception $e) { if ($this->smarty->debugging) {