- bugfix update of 04.08.2016 was incomplete

This commit is contained in:
uwetews
2016-08-07 15:31:01 +02:00
parent 25ad0b3b5a
commit 761e516a32
5 changed files with 19 additions and 12 deletions

View File

@@ -1,9 +1,12 @@
 ===== 3.1.30-dev ===== (xx.xx.xx)  ===== 3.1.30-dev ===== (xx.xx.xx)
05.08.2015 07.08.2016
- bugfix update of 04.08.2016 was incomplete
05.08.2016
- bugfix compiling of templates failed when the Smarty delimiter did contain '/' https://github.com/smarty-php/smarty/issues/264 - bugfix compiling of templates failed when the Smarty delimiter did contain '/' https://github.com/smarty-php/smarty/issues/264
- updated error checking at template and config default handler - updated error checking at template and config default handler
04.08.2015 04.08.2016
- improvement move template function source parameter into extension - improvement move template function source parameter into extension
26.07.2016 26.07.2016

View File

@@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* smarty version * smarty version
*/ */
const SMARTY_VERSION = '3.1.30-dev/91'; const SMARTY_VERSION = '3.1.30-dev/92';
/** /**
* define variable scopes * define variable scopes

View File

@@ -79,10 +79,10 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase
// was there an assign attribute // was there an assign attribute
if (isset($_assign)) { if (isset($_assign)) {
$_output = $_output =
"<?php ob_start();\n\$_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});\n\$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n"; "<?php ob_start();\n\$_smarty_tpl->ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});\n\$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
} else { } else {
$_output = $_output =
"<?php \$_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});?>\n"; "<?php \$_smarty_tpl->ext->_tplFunction->callTemplateFunction(\$_smarty_tpl, {$_name}, {$_params}, {$_nocache});?>\n";
} }
return $_output; return $_output;
} }

View File

@@ -35,16 +35,10 @@ class Smarty_Internal_Runtime_CodeFrame
$properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code; $properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code;
$properties[ 'file_dependency' ] = $_template->compiled->file_dependency; $properties[ 'file_dependency' ] = $_template->compiled->file_dependency;
$properties[ 'includes' ] = $_template->compiled->includes; $properties[ 'includes' ] = $_template->compiled->includes;
if (!empty($compiler->tpl_function)) { } else {
$properties[ 'tpl_function' ] = $compiler->tpl_function;
}
} else {
$properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code; $properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code;
$properties[ 'file_dependency' ] = $_template->cached->file_dependency; $properties[ 'file_dependency' ] = $_template->cached->file_dependency;
$properties[ 'cache_lifetime' ] = $_template->cache_lifetime; $properties[ 'cache_lifetime' ] = $_template->cache_lifetime;
if (!empty($_template->tpl_function)) {
$properties[ 'tpl_function' ] = $_template->tpl_function;
}
} }
$output = "<?php\n"; $output = "<?php\n";
$output .= "/* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . $output .= "/* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") .
@@ -54,6 +48,15 @@ class Smarty_Internal_Runtime_CodeFrame
($cache ? 'true' : 'false') . ")"; ($cache ? 'true' : 'false') . ")";
$output .= "if ({$dec}) {\n"; $output .= "if ({$dec}) {\n";
$output .= "function {$properties['unifunc']} (Smarty_Internal_Template \$_smarty_tpl) {\n"; $output .= "function {$properties['unifunc']} (Smarty_Internal_Template \$_smarty_tpl) {\n";
if (!$cache && !empty($compiler->tpl_function)) {
$output .= "\$_smarty_tpl->ext->_tplFunction->registerTplFunctions(\$_smarty_tpl, " .
var_export($compiler->tpl_function, true) . ");\n";
}
if ($cache && isset($_template->ext->_tplFunction)) {
$output .= "\$_smarty_tpl->ext->_tplFunction->registerTplFunctions(\$_smarty_tpl, " .
var_export($_template->ext->_tplFunction->getTplFunction(), true) . ");\n";
}
// include code for plugins // include code for plugins
if (!$cache) { if (!$cache) {
if (!empty($_template->compiled->required_plugins[ 'compiled' ])) { if (!empty($_template->compiled->required_plugins[ 'compiled' ])) {

View File

@@ -120,6 +120,7 @@ class Smarty_Internal_Runtime_TplFunction
} }
// add template function code to cache file // add template function code to cache file
if (isset($tplPtr->cached)) { if (isset($tplPtr->cached)) {
/* @var Smarty_CacheResource $cache */
$cache = $tplPtr->cached; $cache = $tplPtr->cached;
$content = $cache->read($tplPtr); $content = $cache->read($tplPtr);
if ($content) { if ($content) {