Skip to content

Commit 49f9b82

Browse files
committed
Merge branch 'twig-autoescape' of https://github.com/aleksip/patternengine-php-twig into hotfix-prs
2 parents cf208ac + 4fcf3c1 commit 49f9b82

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"lineageMatchKey": 3,
3636
"patternExtension": "twig",
3737
"twigDebug": false,
38+
"twigAutoescape": "html",
3839
"twigDefaultDateFormat": "",
3940
"twigDefaultIntervalFormat": "",
4041
"twigMacroExt": "macro.twig",

src/PatternLab/PatternEngine/Twig/Loaders/PatternLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function __construct($options = array()) {
2929

3030
// set-up default vars
3131
$twigDebug = Config::getOption("twigDebug");
32+
$twigAutoescape = Config::getOption("twigAutoescape");
3233

3334
// set-up the loader list
3435
$loaders = array();
@@ -57,7 +58,7 @@ public function __construct($options = array()) {
5758

5859
// set-up Twig
5960
$twigLoader = new \Twig_Loader_Chain($loaders);
60-
$this->instance = new \Twig_Environment($twigLoader, array("debug" => $twigDebug));
61+
$this->instance = new \Twig_Environment($twigLoader, array("debug" => $twigDebug, "autoescape" => $twigAutoescape));
6162

6263
// customize Twig
6364
$this->instance = TwigUtil::loadFilters($this->instance);

0 commit comments

Comments
 (0)