diff --git a/NEWS b/NEWS index 8a421eef..73ee1a5b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ + - move Smarty::quote_replace() to Smarty_Compiler::_quote_replace() (messju) + - remove import of of attributes of {include_php} to php's namespace. + use $params[name] instead (messju) + Version 2.6.0-RC3 (Nov 13, 2003) -------------------------------- diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index eeca6497..0c6855ec 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1389,17 +1389,6 @@ class Smarty } } - /** - * Quote subpattern references - * - * @param string $string - * @return string - */ - function quote_replace($string) - { - return preg_replace('![\\$]\d!', '\\\\\\0', $string); - } - /** * get filepath of requested plugin * diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 15a6677c..14fcd1e8 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -265,13 +265,13 @@ class Smarty_Compiler extends Smarty { preg_match_all("!{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}!s", $source_content, $_match); $this->_literal_blocks = $_match[1]; $source_content = preg_replace("!{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}!s", - $this->quote_replace($this->left_delimiter.'literal'.$this->right_delimiter), $source_content); + $this->_quote_replace($this->left_delimiter.'literal'.$this->right_delimiter), $source_content); /* Pull out the php code blocks. */ preg_match_all("!{$ldq}php{$rdq}(.*?){$ldq}/php{$rdq}!s", $source_content, $_match); $this->_php_blocks = $_match[1]; $source_content = preg_replace("!{$ldq}php{$rdq}(.*?){$ldq}/php{$rdq}!s", - $this->quote_replace($this->left_delimiter.'php'.$this->right_delimiter), $source_content); + $this->_quote_replace($this->left_delimiter.'php'.$this->right_delimiter), $source_content); /* Gather all template tags. */ preg_match_all("!{$ldq}\s*(.*?)\s*{$rdq}!s", $source_content, $_match); @@ -336,7 +336,7 @@ class Smarty_Compiler extends Smarty { $strip_tags_modified = preg_replace('![\r\n]+!m', '', $strip_tags_modified); for ($i = 0, $for_max = count($strip_tags); $i < $for_max; $i++) $compiled_content = preg_replace("!{$ldq}strip{$rdq}.*?{$ldq}/strip{$rdq}!s", - $this->quote_replace($strip_tags_modified[$i]), + $this->_quote_replace($strip_tags_modified[$i]), $compiled_content, 1); } @@ -2032,6 +2032,17 @@ class Smarty_Compiler extends Smarty { } + /** + * Quote subpattern references + * + * @param string $string + * @return string + */ + function _quote_replace($string) + { + return preg_replace('![\\$]\d!', '\\\\\\0', $string); + } + /** * display Smarty syntax error *