- bugfix plugins may not be loaded if {function} or {block} tags are executed in nocache mode

This commit is contained in:
Uwe Tews
2018-03-28 07:35:52 +02:00
parent 336c07c23f
commit 860ebb618e
9 changed files with 55 additions and 74 deletions
+5 -9
View File
@@ -5,7 +5,6 @@
* @package Smarty
* @subpackage PluginsFunction
*/
/**
* Smarty {html_select_time} function plugin
* Type: function
@@ -23,17 +22,12 @@
*
* @return string
* @uses smarty_make_timestamp()
* @throws \SmartyException
*/
function smarty_function_html_select_time($params, Smarty_Internal_Template $template)
{
if (!isset($template->smarty->_cache[ '_required_sesc' ])) {
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
$template->smarty->_cache[ '_required_sesc' ] = true;
}
if (!isset($template->smarty->_cache[ '_required_smt' ])) {
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
$template->smarty->_cache[ '_required_smt' ] = true;
}
$template->_checkPlugins(array(array('function' => 'smarty_function_escape_special_chars',
'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php')));
$prefix = 'Time_';
$field_array = null;
$field_separator = "\n";
@@ -84,6 +78,8 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem
switch ($_key) {
case 'time':
if (!is_array($_value) && $_value !== null) {
$template->_checkPlugins(array(array('function' => 'smarty_make_timestamp',
'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php')));
$time = smarty_make_timestamp($_value);
}
break;