- bugfix on <?xml ... ?> tags for all php_handling modes

- bugfix on parameter of variablefilter.htmlspecialchars.php plugin
This commit is contained in:
Uwe.Tews
2010-02-16 20:20:49 +00:00
parent c188b50ecc
commit 44feb88c19
4 changed files with 1599 additions and 1578 deletions

View File

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

View File

@@ -13,7 +13,7 @@
* @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);
}

View File

@@ -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,34 +240,23 @@ 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)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r1_11($yy_subpatterns)
{
@@ -269,7 +264,7 @@ class Smarty_Internal_Templatelexer
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
@@ -277,23 +272,34 @@ class Smarty_Internal_Templatelexer
function yy_r1_12($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
function yy_r1_13($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
function yy_r1_14($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
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