X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=library%2FSmarty%2Flibs%2Fsysplugins%2Fsmarty_internal_smartytemplatecompiler.php;h=50bd16ef2299c71d52196ed89d47c7b4756fee32;hb=7f447368035b558931da5c1785560c4105ccd1e5;hp=1ec1aa43058ffbc89cd1233c02332e6a87b609f2;hpb=ba4db236ecff1ffdb56adc2715b3f53515f8cb34;p=friendica.git diff --git a/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php b/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php index 1ec1aa4305..50bd16ef22 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