readded default_modifiers. who removed that?

This commit is contained in:
messju
2003-12-27 09:25:25 +00:00
parent f5018687c3
commit e335832f62
2 changed files with 10 additions and 7 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- reactivate $smarty->default_modifiers (messju)
- add cookie persistance to debug console (Monte) - add cookie persistance to debug console (Monte)
- allow single-digit days and months without smarty_make_timestamp() - allow single-digit days and months without smarty_make_timestamp()
in html_select_date (messju) in html_select_date (messju)

View File

@@ -1534,14 +1534,16 @@ class Smarty_Compiler extends Smarty {
$val = trim($val); $val = trim($val);
if(preg_match('!^(' . $this->_obj_call_regexp . '|' . $this->_dvar_regexp . ')(' . $this->_mod_regexp . '*)$!', $val, $match)) { if(preg_match('!^(' . $this->_obj_call_regexp . '|' . $this->_dvar_regexp . ')(' . $this->_mod_regexp . '*)$!', $val, $match)) {
// $ variable or object // $ variable or object
$return = $this->_parse_var($match[1]); $return = $this->_parse_var($match[1]);
if($match[2] != '') { $modifiers = $match[2];
$this->_parse_modifiers($return, $match[2]); if (!empty($this->default_modifiers) && !preg_match('!(^|\|)smarty:nodefaults($|\|)!',$modifiers)) {
} $_default_mod_string = implode('|',(array)$this->default_modifiers);
return $return; $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 // double quoted text
preg_match('!^(' . $this->_db_qstr_regexp . ')('. $this->_mod_regexp . '*)$!', $val, $match); preg_match('!^(' . $this->_db_qstr_regexp . ')('. $this->_mod_regexp . '*)$!', $val, $match);
$return = $this->_expand_quoted_text($match[1]); $return = $this->_expand_quoted_text($match[1]);