Skip to content
Snippets Groups Projects
Commit 86bc1cef authored by Jess's avatar Jess
Browse files

Issue #2567139 by Cottser, stefan.r, joelpittet: Twig autoescape default...

Issue #2567139 by Cottser, stefan.r, joelpittet: Twig autoescape default strategy deprecation error triggered on every page load
parent 8b3b8c67
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -82,7 +82,7 @@ public function __construct($root, CacheBackendInterface $cache, $twig_extension ...@@ -82,7 +82,7 @@ public function __construct($root, CacheBackendInterface $cache, $twig_extension
'auto_reload' => NULL, 'auto_reload' => NULL,
); );
// Ensure autoescaping is always on. // Ensure autoescaping is always on.
$options['autoescape'] = TRUE; $options['autoescape'] = 'html';
$this->loader = $loader; $this->loader = $loader;
parent::__construct($this->loader, $options); parent::__construct($this->loader, $options);
......
...@@ -33,7 +33,7 @@ public function testEscaping($template, $expected) { ...@@ -33,7 +33,7 @@ public function testEscaping($template, $expected) {
$twig = new \Twig_Environment(NULL, array( $twig = new \Twig_Environment(NULL, array(
'debug' => TRUE, 'debug' => TRUE,
'cache' => FALSE, 'cache' => FALSE,
'autoescape' => TRUE, 'autoescape' => 'html',
'optimizations' => 0 'optimizations' => 0
)); ));
$twig->addExtension((new TwigExtension($renderer))->setUrlGenerator($this->getMock('Drupal\Core\Routing\UrlGeneratorInterface'))); $twig->addExtension((new TwigExtension($renderer))->setUrlGenerator($this->getMock('Drupal\Core\Routing\UrlGeneratorInterface')));
...@@ -113,7 +113,7 @@ public function testSafeStringEscaping() { ...@@ -113,7 +113,7 @@ public function testSafeStringEscaping() {
$twig = new \Twig_Environment(NULL, array( $twig = new \Twig_Environment(NULL, array(
'debug' => TRUE, 'debug' => TRUE,
'cache' => FALSE, 'cache' => FALSE,
'autoescape' => TRUE, 'autoescape' => 'html',
'optimizations' => 0 'optimizations' => 0
)); ));
$twig_extension = new TwigExtension($renderer); $twig_extension = new TwigExtension($renderer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment