You are here

public function TwigTestExtension::nl2br in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/test/Twig/Tests/IntegrationTest.php \TwigTestExtension::nl2br()

nl2br only, for testing filters with pre_escape.

1 call to TwigTestExtension::nl2br()
TwigTestExtension::escape_and_nl2br in vendor/twig/twig/test/Twig/Tests/IntegrationTest.php
nl2br which also escapes, for testing escaper filters.

File

vendor/twig/twig/test/Twig/Tests/IntegrationTest.php, line 188

Class

TwigTestExtension

Code

public function nl2br($value, $sep = '<br />') {

  // not secure if $value contains html tags (not only entities)
  // don't use
  return str_replace("\n", "{$sep}\n", $value);
}