Skip to content

Commit

Permalink
bug #9639 Modified guessDefaultEscapingStrategy to not escape txt tem…
Browse files Browse the repository at this point in the history
…plates (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
  • Loading branch information
fabpot committed Nov 28, 2013
2 parents 9b99f09 + 9f35368 commit c3b4b68
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Symfony/Bundle/TwigBundle/TwigEngine.php
Expand Up @@ -57,6 +57,10 @@ public function guessDefaultEscapingStrategy($filename)
if ('js' === $format) {
return 'js';
}

if ('txt' === $format) {
return false;
}

return 'html';
}
Expand Down

0 comments on commit c3b4b68

Please sign in to comment.