ignore {strip}/{/strip) inside {strip}-blocks

This commit is contained in:
messju
2003-09-02 10:29:50 +00:00
parent d03febb244
commit 5259481be5
2 changed files with 13 additions and 6 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- ignore {strip}/{/strip) inside {strip}-blocks (messju)
- fixed removal of leading/trailing newlines in {strip}-blocks (messju) - fixed removal of leading/trailing newlines in {strip}-blocks (messju)
- fixed proper escaping of " and ' with escape:javascript (messju) - fixed proper escaping of " and ' with escape:javascript (messju)
- fixed bug in traversal of $smarty->plugins_dir-array. now the - fixed bug in traversal of $smarty->plugins_dir-array. now the

View File

@@ -508,12 +508,18 @@ class Smarty_Compiler extends Smarty {
case 'strip': case 'strip':
case '/strip': case '/strip':
if ($tag_command{0}=='/') if ($tag_command{0}=='/') {
$this->_strip_depth--; if (--$this->_strip_depth==0) { /* outermost closing {/strip} */
else $this->_additional_newline = "\n";
$this->_strip_depth++;
$this->_additional_newline = ($this->_strip_depth>0) ? '' : "\n";
return $this->left_delimiter.$tag_command.$this->right_delimiter; 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': case 'literal':
list (,$literal_block) = each($this->_literal_blocks); list (,$literal_block) = each($this->_literal_blocks);