cvs: smarty / NEWS /libs Smarty_Compiler.class.php

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1072517126@cvsserver>
messju		Sat Dec 27 04:25:26 2003 EDT

  Modified files:              
    /smarty	NEWS 
    /smarty/libs	Smarty_Compiler.class.php 
  Log:
  readded default_modifiers. who removed that?
  
  
Index: smarty/NEWS
diff -u smarty/NEWS:1.419 smarty/NEWS:1.420
--- smarty/NEWS:1.419	Tue Dec 23 10:53:39 2003
+++ smarty/NEWS	Sat Dec 27 04:25:24 2003
@@ -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)
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.303 smarty/libs/Smarty_Compiler.class.php:1.304
--- smarty/libs/Smarty_Compiler.class.php:1.303	Thu Dec 11 14:52:38 2003
+++ smarty/libs/Smarty_Compiler.class.php	Sat Dec 27 04:25:25 2003
@@ -39,7 +39,7 @@
  * @package Smarty
  */
 
-/* $Id: Smarty_Compiler.class.php,v 1.303 2003/12/11 19:52:38 messju Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.304 2003/12/27 09:25:25 messju Exp $ */
 
 /**
  * Template compiling class
@@ -1534,14 +1534,16 @@
         $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;
-            }
-        elseif(preg_match('!^' . $this->_db_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$!', $val)) {
+            // $ 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;
+            }
+            $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]);

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.