Twig_Tests_Extension_EscaperTest
extends TestCase
Table of Contents
-
$cssSpecialChars
: mixed
-
$htmlAttrSpecialChars
: mixed
-
$htmlSpecialChars
: mixed
- All character encodings supported by htmlspecialchars().
-
$jsSpecialChars
: mixed
-
$urlSpecialChars
: mixed
-
provideCustomEscaperCases()
: mixed
-
provideObjectsForEscaping()
: mixed
-
testCssEscapingConvertsSpecialChars()
: mixed
-
testCssEscapingEscapesOwaspRecommendedRanges()
: mixed
-
testCssEscapingReturnsStringIfContainsOnlyDigits()
: mixed
-
testCssEscapingReturnsStringIfZeroLength()
: mixed
-
testCustomEscaper()
: mixed
-
testHtmlAttributeEscapingConvertsSpecialChars()
: mixed
-
testHtmlAttributeEscapingEscapesOwaspRecommendedRanges()
: mixed
-
testHtmlEscapingConvertsSpecialChars()
: mixed
-
testJavascriptEscapingConvertsSpecialChars()
: mixed
-
testJavascriptEscapingEscapesOwaspRecommendedRanges()
: mixed
-
testJavascriptEscapingReturnsStringIfContainsOnlyDigits()
: mixed
-
testJavascriptEscapingReturnsStringIfZeroLength()
: mixed
-
testObjectEscaping()
: mixed
-
testUnicodeCodepointConversionToUtf8()
: mixed
- Only testing the first few 2 ranges on this prot. function as that's all these
other range tests require.
-
testUnknownCustomEscaper()
: mixed
-
testUrlEscapingConvertsSpecialChars()
: mixed
-
codepointToUtf8()
: string
- Convert a Unicode Codepoint to a literal UTF-8 character.
$cssSpecialChars
protected
mixed
$cssSpecialChars
= [
/* HTML special chars - escape without exception to hex */
'<' => '\3C ',
'>' => '\3E ',
''' => '\27 ',
'"' => '\22 ',
'&' => '\26 ',
/* Characters beyond ASCII value 255 to unicode escape */
'Ā' => '\100 ',
/* Immune chars excluded */
',' => '\2C ',
'.' => '\2E ',
'_' => '\5F ',
/* Basic alnums excluded */
'a' => 'a',
'A' => 'A',
'z' => 'z',
'Z' => 'Z',
'0' => '0',
'9' => '9',
/* Basic control characters and null */
"
" => '\D ',
"
" => '\A ',
" " => '\9 ',
"