From 967ab871b836f618107fe144978bd1453c3c6634 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 11 Dec 2014 20:15:27 +0000 Subject: Update Smarty --- .../smarty_internal_smartytemplatecompiler.php | 43 ++++++++++++++-------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php') diff --git a/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php b/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php index 1ec1aa430..50bd16ef2 100644 --- a/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php +++ b/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php @@ -1,27 +1,26 @@ lex = new $this->lexer_class($_content, $this); $this->parser = new $this->parser_class($this->lex, $this); - if ($this->smarty->_parserdebug) + if ($this->inheritance_child) { + // start state on child templates + $this->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBODY); + } + if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } else { + $mbEncoding = null; + } + + if ($this->smarty->_parserdebug) { $this->parser->PrintTrace(); + $this->lex->PrintTrace(); + } // get tokens from lexer and parse them while ($this->lex->yylex() && !$this->abort_and_recompile) { if ($this->smarty->_parserdebug) { @@ -111,17 +124,17 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom } // finish parsing process $this->parser->doParse(0, 0); + if ($mbEncoding) { + mb_internal_encoding($mbEncoding); + } // check for unclosed tags if (count($this->_tag_stack) > 0) { // get stacked info list($openTag, $_data) = array_pop($this->_tag_stack); - $this->trigger_template_error("unclosed {" . $openTag . "} tag"); + $this->trigger_template_error("unclosed {$this->smarty->left_delimiter}" . $openTag . "{$this->smarty->right_delimiter} tag"); } // return compiled code // return str_replace(array("? >\nparser->retvalue); return $this->parser->retvalue; } - } - -?> \ No newline at end of file -- cgit v1.2.3