MediaWiki
REL1_24
|
Utility class used by CSSJanus that tokenizes and untokenizes things we want to protect from being janused. More...
Public Member Functions | |
__construct ($regex, $token) | |
Constructor. | |
detokenize ($str) | |
Replace tokens with their originals. | |
tokenize ($str) | |
Replace all occurrences of $regex in $str with a token and remember the original strings. | |
Private Member Functions | |
detokenizeCallback ($matches) | |
tokenizeCallback ($matches) | |
Private Attributes | |
$originals | |
$regex | |
$token |
Utility class used by CSSJanus that tokenizes and untokenizes things we want to protect from being janused.
Definition at line 396 of file CSSJanus.php.
CSSJanusTokenizer::__construct | ( | $ | regex, |
$ | token | ||
) |
Constructor.
string | $regex | Regular expression whose matches to replace by a token. |
string | $token | Token |
Definition at line 406 of file CSSJanus.php.
CSSJanusTokenizer::detokenize | ( | $ | str | ) |
Replace tokens with their originals.
If multiple strings were tokenized, it's important they be detokenized in exactly the SAME ORDER.
string | $str | previously run through tokenize() |
Definition at line 437 of file CSSJanus.php.
References array().
CSSJanusTokenizer::detokenizeCallback | ( | $ | matches | ) | [private] |
CSSJanusTokenizer::tokenize | ( | $ | str | ) |
Replace all occurrences of $regex in $str with a token and remember the original strings.
string | $str | to tokenize |
Definition at line 418 of file CSSJanus.php.
References array().
CSSJanusTokenizer::tokenizeCallback | ( | $ | matches | ) | [private] |
$matches | array |
Definition at line 426 of file CSSJanus.php.
References $matches.
CSSJanusTokenizer::$originals [private] |
Definition at line 399 of file CSSJanus.php.
CSSJanusTokenizer::$regex [private] |
Definition at line 397 of file CSSJanus.php.
Referenced by __construct().
CSSJanusTokenizer::$token [private] |
Definition at line 398 of file CSSJanus.php.
Referenced by __construct().