summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Tews <uwe.tews@googlemail.com>2015-06-27 15:35:27 +0200
committerUwe Tews <uwe.tews@googlemail.com>2015-06-27 15:35:27 +0200
commit3239a194359d0579deac5aba5e060e248fec3ef0 (patch)
treeee4b4ce5680bdbc6812d6a0b5421f748376536c1
parent6b875397a5f561532e719db815736559f0610ad4 (diff)
downloadsmarty-3239a194359d0579deac5aba5e060e248fec3ef0.tar.gz
smarty-3239a194359d0579deac5aba5e060e248fec3ef0.tar.bz2
smarty-3239a194359d0579deac5aba5e060e248fec3ef0.zip
- bugfix resolve naming conflict between custom Smarty delimiter '<%' and PHP ASP tags https://github.com/smarty-php/smarty/issues/64
-rw-r--r--change_log.txt8
-rw-r--r--lexer/smarty_internal_templatelexer.plex8
-rw-r--r--libs/Smarty.class.php2
-rw-r--r--libs/sysplugins/smarty_internal_templatelexer.php20
4 files changed, 17 insertions, 21 deletions
diff --git a/change_log.txt b/change_log.txt
index 05ddedce..9cea8e6e 100644
--- a/change_log.txt
+++ b/change_log.txt
@@ -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
diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex
index e36df597..a74c4038 100644
--- a/lexer/smarty_internal_templatelexer.plex
+++ b/lexer/smarty_internal_templatelexer.plex
@@ -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);
diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php
index 437b4704..a7f429de 100644
--- a/libs/Smarty.class.php
+++ b/libs/Smarty.class.php
@@ -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
diff --git a/libs/sysplugins/smarty_internal_templatelexer.php b/libs/sysplugins/smarty_internal_templatelexer.php
index abf81d08..701d7b7d 100644
--- a/libs/sysplugins/smarty_internal_templatelexer.php
+++ b/libs/sysplugins/smarty_internal_templatelexer.php
@@ -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
@@ -347,13 +347,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) {
$this->token = Smarty_Internal_Templateparser::TP_TEXT;
} else {
@@ -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()
{