mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- bugfix update of 04.08.2016 was incomplete
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
===== 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
|
||||
- updated error checking at template and config default handler
|
||||
|
||||
04.08.2015
|
||||
04.08.2016
|
||||
- improvement move template function source parameter into extension
|
||||
|
||||
26.07.2016
|
||||
|
@@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
||||
/**
|
||||
* smarty version
|
||||
*/
|
||||
const SMARTY_VERSION = '3.1.30-dev/91';
|
||||
const SMARTY_VERSION = '3.1.30-dev/92';
|
||||
|
||||
/**
|
||||
* define variable scopes
|
||||
|
@@ -79,10 +79,10 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase
|
||||
// was there an assign attribute
|
||||
if (isset($_assign)) {
|
||||
$_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 {
|
||||
$_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;
|
||||
}
|
||||
|
@@ -35,16 +35,10 @@ class Smarty_Internal_Runtime_CodeFrame
|
||||
$properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code;
|
||||
$properties[ 'file_dependency' ] = $_template->compiled->file_dependency;
|
||||
$properties[ 'includes' ] = $_template->compiled->includes;
|
||||
if (!empty($compiler->tpl_function)) {
|
||||
$properties[ 'tpl_function' ] = $compiler->tpl_function;
|
||||
}
|
||||
} else {
|
||||
$properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code;
|
||||
$properties[ 'file_dependency' ] = $_template->cached->file_dependency;
|
||||
$properties[ 'cache_lifetime' ] = $_template->cache_lifetime;
|
||||
if (!empty($_template->tpl_function)) {
|
||||
$properties[ 'tpl_function' ] = $_template->tpl_function;
|
||||
}
|
||||
}
|
||||
$output = "<?php\n";
|
||||
$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') . ")";
|
||||
$output .= "if ({$dec}) {\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
|
||||
if (!$cache) {
|
||||
if (!empty($_template->compiled->required_plugins[ 'compiled' ])) {
|
||||
|
@@ -120,6 +120,7 @@ class Smarty_Internal_Runtime_TplFunction
|
||||
}
|
||||
// add template function code to cache file
|
||||
if (isset($tplPtr->cached)) {
|
||||
/* @var Smarty_CacheResource $cache */
|
||||
$cache = $tplPtr->cached;
|
||||
$content = $cache->read($tplPtr);
|
||||
if ($content) {
|
||||
|
Reference in New Issue
Block a user