MediaWiki
REL1_19
|
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. | |
Public Attributes | |
$token | |
Private Member Functions | |
detokenizeCallback ($matches) | |
tokenizeCallback ($matches) | |
Private Attributes | |
$originals | |
$regex |
Utility class used by CSSJanus that tokenizes and untokenizes things we want to protect from being janused.
Definition at line 291 of file CSSJanus.php.
CSSJanus_Tokenizer::__construct | ( | $ | regex, |
$ | token | ||
) |
Constructor.
$regex | string Regular expression whose matches to replace by a token. |
$token | string Token |
Definition at line 300 of file CSSJanus.php.
CSSJanus_Tokenizer::detokenize | ( | $ | str | ) |
Replace tokens with their originals.
If multiple strings were tokenized, it's important they be detokenized in exactly the SAME ORDER.
$str | String: previously run through tokenize() |
Definition at line 331 of file CSSJanus.php.
CSSJanus_Tokenizer::detokenizeCallback | ( | $ | matches | ) | [private] |
CSSJanus_Tokenizer::tokenize | ( | $ | str | ) |
Replace all occurrences of $regex in $str with a token and remember the original strings.
$str | String to tokenize |
Definition at line 312 of file CSSJanus.php.
CSSJanus_Tokenizer::tokenizeCallback | ( | $ | matches | ) | [private] |
$matches | array |
Definition at line 320 of file CSSJanus.php.
References $matches.
CSSJanus_Tokenizer::$originals [private] |
Definition at line 293 of file CSSJanus.php.
CSSJanus_Tokenizer::$regex [private] |
Definition at line 292 of file CSSJanus.php.
Referenced by __construct().
CSSJanus_Tokenizer::$token |
Definition at line 292 of file CSSJanus.php.
Referenced by __construct().