mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
fixed bug with autoload-handling of modifiers. thanks andre.
This commit is contained in:
@@ -1773,24 +1773,17 @@ class Smarty_Compiler extends Smarty {
|
|||||||
$_map_array = true;
|
$_map_array = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->_plugins['modifier'][$_modifier_name])
|
|
||||||
|| (isset($this->_plugin_info['modifier']) && isset($this->_plugin_info['modifier'][$_modifier_name]))) {
|
|
||||||
/* modifier is already known */
|
|
||||||
} elseif ($this->_get_plugin_filepath('modifier', $_modifier_name)) {
|
|
||||||
$this->_add_plugin('modifier', $_modifier_name);
|
$this->_add_plugin('modifier', $_modifier_name);
|
||||||
} elseif (function_exists($_modifier_name)) {
|
if (empty($this->_plugins['modifier'][$_modifier_name])
|
||||||
|
&& !$this->_get_plugin_filepath('modifier', $_modifier_name)
|
||||||
|
&& function_exists($_modifier_name)) {
|
||||||
if ($this->security && !in_array($_modifier_name, $this->security_settings['MODIFIER_FUNCS'])) {
|
if ($this->security && !in_array($_modifier_name, $this->security_settings['MODIFIER_FUNCS'])) {
|
||||||
$this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $_tpl_file, $_tpl_line, __FILE__, __LINE__);
|
$this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $_tpl_file, $_tpl_line, __FILE__, __LINE__);
|
||||||
} else {
|
} else {
|
||||||
$this->_plugins['modifier'][$_modifier_name] = array($_modifier_name, null, null, false);
|
$this->_plugins['modifier'][$_modifier_name] = array($_modifier_name, null, null, false);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/* modifier not found */
|
|
||||||
$this->_syntax_error("[plugin] modifier '$_modifier_name' not found", E_USER_ERROR, __FILE__, __LINE__);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->_parse_vars_props($_modifier_args);
|
$this->_parse_vars_props($_modifier_args);
|
||||||
|
|
||||||
if($_modifier_name == 'default') {
|
if($_modifier_name == 'default') {
|
||||||
|
Reference in New Issue
Block a user