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+)|()|([?][>])|([%][>])|(" . $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+)|()|([?][>])|([%][>])|(" . $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() {