mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
move Smarty::quote_replace() to Smarty_Compiler::_quote_replace()
This commit is contained in:
4
NEWS
4
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)
|
||||
--------------------------------
|
||||
|
||||
|
@@ -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
|
||||
*
|
||||
|
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user