- bugfix <?xml ... ?> including template variables broken since 3.1.22 https://github.com/smarty-php/smarty/issues/47

This commit is contained in:
Uwe Tews
2015-06-01 22:26:45 +02:00
parent 3771ea8d35
commit fa269d418f
7 changed files with 754 additions and 729 deletions
@@ -106,7 +106,9 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
$lex->taglineno = $lex->line;
$closeTag = '?>';
if (strpos($lex->value, '<?xml') === 0) {
$lex->phpType = 'xml';
$lex->is_xml = true;
$lex->token = Smarty_Internal_Templateparser::TP_NOCACHE;
return;
} elseif (strpos($lex->value, '<?') === 0) {
$lex->phpType = 'php';
} elseif (strpos($lex->value, '<%') === 0) {
@@ -115,6 +117,11 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
} elseif (strpos($lex->value, '%>') === 0) {
$lex->phpType = 'unmatched';
} elseif (strpos($lex->value, '?>') === 0) {
if ($lex->is_xml) {
$lex->is_xml = false;
$lex->token = Smarty_Internal_Templateparser::TP_NOCACHE;
return;
}
$lex->phpType = 'unmatched';
} elseif (strpos($lex->value, '<s') === 0) {
$lex->phpType = 'script';