fixed bug with autoload-handling of modifiers. thanks andre.

This commit is contained in:
messju
2003-08-06 08:16:29 +00:00
parent c770ad9c37
commit 7232d718dd

View File

@@ -1773,24 +1773,17 @@ class Smarty_Compiler extends Smarty {
$_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);
} elseif (function_exists($_modifier_name)) {
$this->_add_plugin('modifier', $_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'])) {
$this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $_tpl_file, $_tpl_line, __FILE__, __LINE__);
} else {
$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);
if($_modifier_name == 'default') {