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

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1062498590@cvsserver>
messju		Tue Sep  2 06:29:50 2003 EDT

  Modified files:              
    /smarty	NEWS 
    /smarty/libs	Smarty_Compiler.class.php 
  Log:
  ignore {strip}/{/strip) inside {strip}-blocks
  
  
Index: smarty/NEWS
diff -u smarty/NEWS:1.393 smarty/NEWS:1.394
--- smarty/NEWS:1.393	Wed Aug 27 04:54:24 2003
+++ smarty/NEWS	Tue Sep  2 06:29:49 2003
@@ -1,3 +1,4 @@
+  - ignore {strip}/{/strip) inside {strip}-blocks (messju)
   - fixed removal of leading/trailing newlines in {strip}-blocks (messju)
   - fixed proper escaping of " and ' with escape:javascript (messju)
   - fixed bug in traversal of $smarty->plugins_dir-array. now the
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.280 smarty/libs/Smarty_Compiler.class.php:1.281
--- smarty/libs/Smarty_Compiler.class.php:1.280	Mon Sep  1 14:17:58 2003
+++ smarty/libs/Smarty_Compiler.class.php	Tue Sep  2 06:29:50 2003
@@ -39,7 +39,7 @@
  * @package Smarty
  */
 
-/* $Id: Smarty_Compiler.class.php,v 1.280 2003/09/01 18:17:58 messju Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.281 2003/09/02 10:29:50 messju Exp $ */
 
 /**
  * Template compiling class
@@ -508,12 +508,18 @@
 
             case 'strip':
             case '/strip':
-                if ($tag_command{0}=='/')
-                    $this->_strip_depth--;
-                else
-                    $this->_strip_depth++;
-                $this->_additional_newline = ($this->_strip_depth>0) ? '' : "\n";
-                return $this->left_delimiter.$tag_command.$this->right_delimiter;
+                if ($tag_command{0}=='/') {
+                    if (--$this->_strip_depth==0) { /* outermost closing {/strip} */
+                        $this->_additional_newline = "\n";
+                        return $this->left_delimiter.$tag_command.$this->right_delimiter;
+                    }
+                } else {
+                    if ($this->_strip_depth++==0) { /* outermost opening {strip} */
+                        $this->_additional_newline = "";
+                        return $this->left_delimiter.$tag_command.$this->right_delimiter;
+                    }
+                }
+                return '';
 
             case 'literal':
                 list (,$literal_block) = each($this->_literal_blocks);

-- 
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.