summaryrefslogtreecommitdiff
path: root/lexer/smarty_internal_templatelexer.plex
diff options
context:
space:
mode:
authorUwe Tews <uwe.tews@googlemail.com>2015-06-27 16:09:50 +0200
committerUwe Tews <uwe.tews@googlemail.com>2015-06-27 16:09:50 +0200
commit9986286af0e0596b1ecf3594a672d657808ec725 (patch)
tree07f4f0a9713e5b70aa9a6a394c0a117ecfadf056 /lexer/smarty_internal_templatelexer.plex
parent3239a194359d0579deac5aba5e060e248fec3ef0 (diff)
downloadsmarty-9986286af0e0596b1ecf3594a672d657808ec725.tar.gz
smarty-9986286af0e0596b1ecf3594a672d657808ec725.tar.bz2
smarty-9986286af0e0596b1ecf3594a672d657808ec725.zip
- bugfix resolve naming conflict between custom Smarty delimiter '<%' and PHP ASP tags https://github.com/smarty-php/smarty/issues/64
Diffstat (limited to 'lexer/smarty_internal_templatelexer.plex')
-rw-r--r--lexer/smarty_internal_templatelexer.plex7
1 files changed, 6 insertions, 1 deletions
diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex
index a74c4038..3c6d9ca9 100644
--- a/lexer/smarty_internal_templatelexer.plex
+++ b/lexer/smarty_internal_templatelexer.plex
@@ -260,7 +260,8 @@ class Smarty_Internal_Templatelexer
namespace = ~([0-9]*[a-zA-Z_]\w*)?(\\[0-9]*[a-zA-Z_]\w*)+~
all = ~[\S\s]+~
emptyjava = ~[{][}]~
- phpstart = ~(<[?]((php\s+|=)|\s+))|(<[%])|(<[?]xml\s+)|(<script\s+language\s*=\s*["']?\s*php\s*["']?\s*>)|([?][>])|([%][>])|(SMARTYldel\s*php(.*?)SMARTYrdel)|(SMARTYldel\s*[/]phpSMARTYrdel)~
+ phptag = ~(SMARTYldel\s*php(.*?)SMARTYrdel)|(SMARTYldel\s*[/]phpSMARTYrdel)~
+ phpstart = ~(<[?]((php\s+|=)|\s+))|(<[%])|(<[?]xml\s+)|(<script\s+language\s*=\s*["']?\s*php\s*["']?\s*>)|([?][>])|([%][>])~
slash = ~[/]~
ldel = ~SMARTYldel\s*~
rdel = ~\s*SMARTYrdel~
@@ -331,6 +332,10 @@ class Smarty_Internal_Templatelexer
$this->value = substr($this->data,$this->counter,$to-$this->counter);
return false;
}
+ phptag {
+ $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;