Skip to content

Commit c3b4b68

Browse files
committed
bug #9639 Modified guessDefaultEscapingStrategy to not escape txt templates (fabpot)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9639). Discussion ---------- Modified guessDefaultEscapingStrategy to not escape txt templates This PR was submitted on the symfony/TwigBundle read-only repository and moved automatically to the main Symfony repository (closes symfony/twig-bundle#2). Useful for plaintext emails. Commits ------- 6affe94 Modified guessDefaultEscapingStrategy to not escape txt templates
2 parents 9b99f09 + 9f35368 commit c3b4b68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bundle/TwigBundle/TwigEngine.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ public function guessDefaultEscapingStrategy($filename)
5757
if ('js' === $format) {
5858
return 'js';
5959
}
60+
61+
if ('txt' === $format) {
62+
return false;
63+
}
6064

6165
return 'html';
6266
}

0 commit comments

Comments
 (0)