mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
- bugfix on <?xml ... ?> tags for all php_handling modes
- bugfix on parameter of variablefilter.htmlspecialchars.php plugin
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
16/02/2010
|
||||
- bugfix on <?xml ... ?> tags for all php_handling modes
|
||||
- bugfix on parameter of variablefilter.htmlspecialchars.php plugin
|
||||
|
||||
14/02/2010
|
||||
- added missing _plugins property in smarty.class.php
|
||||
- bugfix $smarty.const... inside doublequoted strings and backticks was compiled into wrong PHP code
|
||||
|
@@ -13,9 +13,9 @@
|
||||
* @param object $ &$smarty Smarty object
|
||||
* @return string filtered output
|
||||
*/
|
||||
function smarty_variablefilter_htmlspecialchars($source, &$smarty)
|
||||
function smarty_variablefilter_htmlspecialchars($source, $smarty)
|
||||
{
|
||||
return htmlspecialchars($source, ENT_QUOTES);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -144,13 +144,14 @@ class Smarty_Internal_Templatelexer
|
||||
11 => 0,
|
||||
12 => 0,
|
||||
13 => 0,
|
||||
14 => 2,
|
||||
17 => 0,
|
||||
14 => 0,
|
||||
15 => 2,
|
||||
18 => 0,
|
||||
);
|
||||
if ($this->counter >= strlen($this->data)) {
|
||||
return false; // end of input
|
||||
}
|
||||
$yy_global_pattern = "/^(\\{\\})|^(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^(\\?>)|^([\t ]*[\r\n]+[\t ]*)|^(".$this->ldel."strip".$this->rdel.")|^(".$this->ldel."\/strip".$this->rdel.")|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."|<\\?|\\?>)))|^([\S\s]+)/";
|
||||
$yy_global_pattern = "/^(\\{\\})|^(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|^(<\\?xml.*\\?>)|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^(\\?>)|^([\t ]*[\r\n]+[\t ]*)|^(".$this->ldel."strip".$this->rdel.")|^(".$this->ldel."\/strip".$this->rdel.")|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."|<\\?|\\?>)))|^([\S\s]+)/";
|
||||
|
||||
do {
|
||||
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
|
||||
@@ -213,6 +214,11 @@ class Smarty_Internal_Templatelexer
|
||||
function yy_r1_4($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_XMLTAG;
|
||||
}
|
||||
function yy_r1_5($yy_subpatterns)
|
||||
{
|
||||
|
||||
if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
|
||||
$this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
|
||||
} else {
|
||||
@@ -220,12 +226,12 @@ class Smarty_Internal_Templatelexer
|
||||
$this->value = substr($this->value, 0, 2);
|
||||
}
|
||||
}
|
||||
function yy_r1_5($yy_subpatterns)
|
||||
function yy_r1_6($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
|
||||
}
|
||||
function yy_r1_6($yy_subpatterns)
|
||||
function yy_r1_7($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->strip) {
|
||||
@@ -234,25 +240,25 @@ class Smarty_Internal_Templatelexer
|
||||
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
|
||||
}
|
||||
}
|
||||
function yy_r1_7($yy_subpatterns)
|
||||
function yy_r1_8($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->strip = true;
|
||||
return false;
|
||||
}
|
||||
function yy_r1_8($yy_subpatterns)
|
||||
function yy_r1_9($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->strip = false;
|
||||
return false;
|
||||
}
|
||||
function yy_r1_9($yy_subpatterns)
|
||||
function yy_r1_10($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
|
||||
$this->yypushstate(self::LITERAL);
|
||||
}
|
||||
function yy_r1_10($yy_subpatterns)
|
||||
function yy_r1_11($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -263,7 +269,7 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
function yy_r1_11($yy_subpatterns)
|
||||
function yy_r1_12($yy_subpatterns)
|
||||
{
|
||||
|
||||
if ($this->smarty->auto_literal) {
|
||||
@@ -274,26 +280,26 @@ class Smarty_Internal_Templatelexer
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
}
|
||||
function yy_r1_12($yy_subpatterns)
|
||||
function yy_r1_13($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
|
||||
$this->yypushstate(self::SMARTY);
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
function yy_r1_13($yy_subpatterns)
|
||||
function yy_r1_14($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
|
||||
$this->yypushstate(self::SMARTY);
|
||||
$this->taglineno = $this->line;
|
||||
}
|
||||
function yy_r1_14($yy_subpatterns)
|
||||
function yy_r1_15($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
|
||||
}
|
||||
function yy_r1_17($yy_subpatterns)
|
||||
function yy_r1_18($yy_subpatterns)
|
||||
{
|
||||
|
||||
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user