- bugfix resolve naming conflict between custom Smarty delimiter '<%' and PHP ASP tags https://github.com/smarty-php/smarty/issues/64

This commit is contained in:
Uwe Tews
2015-06-27 15:35:27 +02:00
parent 6b875397a5
commit 3239a19435
4 changed files with 17 additions and 21 deletions

View File

@@ -1,10 +1,6 @@
 ===== 3.1.28-dev===== (xx.xx.2015)
21.06.2015
- optimization of template/config file normalization
- optimization of directory handling / build realpath
- optimization of filter execution
- move registerObject / registerClass into extension
- update realpath handling
27.06.2015
- bugfix resolve naming conflict between custom Smarty delimiter '<%' and PHP ASP tags https://github.com/smarty-php/smarty/issues/64
19.06.2015
- improvement allow closures as callback at $smarty->registerFilter() https://github.com/smarty-php/smarty/issues/59

View File

@@ -331,10 +331,6 @@ class Smarty_Internal_Templatelexer
$this->value = substr($this->data,$this->counter,$to-$this->counter);
return false;
}
phpstart {
$obj = new Smarty_Internal_Compile_Private_Php();
$obj->parsePhp($this);
}
ldel literal rdel {
if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
@@ -354,6 +350,10 @@ class Smarty_Internal_Templatelexer
rdel {
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
}
phpstart {
$obj = new Smarty_Internal_Compile_Private_Php();
$obj->parsePhp($this);
}
text {
$to = strlen($this->data);
preg_match("~($this->ldel)|([<]script\s+language\s*=\s*[\"\']?\s*php\s*[\"\']?\s*[>])|([<][?])|([<][%])|([?][>])|([%][>])~i",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter);

View File

@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.28-dev/6';
const SMARTY_VERSION = '3.1.28-dev/7';
/**
* define variable scopes

View File

@@ -277,7 +277,7 @@ class Smarty_Internal_Templatelexer
public function yylex1()
{
if (!isset($this->yy_global_pattern1)) {
$this->yy_global_pattern1 = "/\G([{][}])|\G(" . $this->ldel . "[*])|\G((<[?]((php\\s+|=)|\\s+))|(<[%])|(<[?]xml\\s+)|(<script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>)|([?][>])|([%][>])|(" . $this->ldel . "\\s*php(.*?)" . $this->rdel . ")|(" . $this->ldel . "\\s*[\/]php" . $this->rdel . "))|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*)|\G(\\s*" . $this->rdel . ")|\G([\S\s])/isS";
$this->yy_global_pattern1 = "/\G([{][}])|\G(" . $this->ldel . "[*])|\G(" . $this->ldel . "\\s*literal\\s*" . $this->rdel . ")|\G(" . $this->ldel . "\\s*)|\G(\\s*" . $this->rdel . ")|\G((<[?]((php\\s+|=)|\\s+))|(<[%])|(<[?]xml\\s+)|(<script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*>)|([?][>])|([%][>])|(" . $this->ldel . "\\s*php(.*?)" . $this->rdel . ")|(" . $this->ldel . "\\s*[\/]php" . $this->rdel . "))|\G([\S\s])/isS";
}
if ($this->counter >= strlen($this->data)) {
return false; // end of input
@@ -345,13 +345,6 @@ class Smarty_Internal_Templatelexer
}
function yy_r1_3()
{
$obj = new Smarty_Internal_Compile_Private_Php();
$obj->parsePhp($this);
}
function yy_r1_15()
{
if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -362,7 +355,7 @@ class Smarty_Internal_Templatelexer
}
}
function yy_r1_16()
function yy_r1_4()
{
if ($this->smarty->auto_literal && isset($this->value[$this->ldel_length]) ? strpos(" \n\t\r", $this->value[$this->ldel_length]) !== false : false) {
@@ -373,12 +366,19 @@ class Smarty_Internal_Templatelexer
}
}
function yy_r1_17()
function yy_r1_5()
{
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
}
function yy_r1_6()
{
$obj = new Smarty_Internal_Compile_Private_Php();
$obj->parsePhp($this);
}
function yy_r1_18()
{