diff --git a/NEWS b/NEWS index f420def4..ad0f29b8 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - reactivate $smarty->default_modifiers (messju) - add cookie persistance to debug console (Monte) - allow single-digit days and months without smarty_make_timestamp() in html_select_date (messju) diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 3199d044..0bc82cfb 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1534,14 +1534,16 @@ class Smarty_Compiler extends Smarty { $val = trim($val); if(preg_match('!^(' . $this->_obj_call_regexp . '|' . $this->_dvar_regexp . ')(' . $this->_mod_regexp . '*)$!', $val, $match)) { - // $ variable or object - $return = $this->_parse_var($match[1]); - if($match[2] != '') { - $this->_parse_modifiers($return, $match[2]); - } - return $return; + // $ variable or object + $return = $this->_parse_var($match[1]); + $modifiers = $match[2]; + if (!empty($this->default_modifiers) && !preg_match('!(^|\|)smarty:nodefaults($|\|)!',$modifiers)) { + $_default_mod_string = implode('|',(array)$this->default_modifiers); + $modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers; } - elseif(preg_match('!^' . $this->_db_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$!', $val)) { + $this->_parse_modifiers($return, $modifiers); + return $return; + } elseif (preg_match('!^' . $this->_db_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$!', $val)) { // double quoted text preg_match('!^(' . $this->_db_qstr_regexp . ')('. $this->_mod_regexp . '*)$!', $val, $match); $return = $this->_expand_quoted_text($match[1]);