You are here

protected property Twig_Test_EscapingTest::$htmlAttrSpecialChars in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/test/Twig/Tests/escapingTest.php \Twig_Test_EscapingTest::htmlAttrSpecialChars

File

vendor/twig/twig/test/Twig/Tests/escapingTest.php, line 22

Class

Twig_Test_EscapingTest
This class is adapted from code coming from Zend Framework.

Code

protected $htmlAttrSpecialChars = array(
  '\'' => ''',
  /* Characters beyond ASCII value 255 to unicode escape */
  'Ā' => 'Ā',
  /* Immune chars excluded */
  ',' => ',',
  '.' => '.',
  '-' => '-',
  '_' => '_',
  /* Basic alnums excluded */
  'a' => 'a',
  'A' => 'A',
  'z' => 'z',
  'Z' => 'Z',
  '0' => '0',
  '9' => '9',
  /* Basic control characters and null */
  "\r" => '
',
  "\n" => '
',
  "\t" => '	',
  "\0" => '�',
  // should use Unicode replacement char
  
  /* Encode chars as named entities where possible */
  '<' => '&lt;',
  '>' => '&gt;',
  '&' => '&amp;',
  '"' => '&quot;',
  /* Encode spaces for quoteless attribute protection */
  ' ' => '&#x20;',
);