X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FTemplateParser.php;h=11a8e85656ab24bb171088fa22288f7c5ad60c2e;hb=a38af7ba26579bb3004f673e44d39710887763aa;hp=4210a965baafbf7f43b89b1cea0d9e79dcc43b34;hpb=15f6eff90c305d405fe4331c8a8dc8caa842e5b3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/TemplateParser.php b/includes/TemplateParser.php index 4210a965ba..11a8e85656 100644 --- a/includes/TemplateParser.php +++ b/includes/TemplateParser.php @@ -41,9 +41,7 @@ class TemplateParser { /** * @var int Compilation flags passed to LightnCandy */ - // Do not add more flags here without discussion. - // If you do add more flags, be sure to update unit tests as well. - protected $compileFlags = LightnCandy::FLAG_ERROR_EXCEPTION; + protected $compileFlags; /** * @param string|null $templateDir @@ -52,6 +50,10 @@ class TemplateParser { public function __construct( $templateDir = null, $forceRecompile = false ) { $this->templateDir = $templateDir ?: __DIR__ . '/templates'; $this->forceRecompile = $forceRecompile; + + // Do not add more flags here without discussion. + // If you do add more flags, be sure to update unit tests as well. + $this->compileFlags = LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_MUSTACHELOOKUP; } /** @@ -218,6 +220,6 @@ class TemplateParser { */ public function processTemplate( $templateName, $args, array $scopes = [] ) { $template = $this->getTemplate( $templateName ); - return call_user_func( $template, $args, $scopes ); + return $template( $args, $scopes ); } }