|
MediaWiki
REL1_20
|
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 301 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 310 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 341 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 322 of file CSSJanus.php.
| CSSJanus_Tokenizer::tokenizeCallback | ( | $ | matches | ) | [private] |
| $matches | array |
Definition at line 330 of file CSSJanus.php.
References $matches.
CSSJanus_Tokenizer::$originals [private] |
Definition at line 303 of file CSSJanus.php.
CSSJanus_Tokenizer::$regex [private] |
Definition at line 302 of file CSSJanus.php.
Referenced by __construct().
| CSSJanus_Tokenizer::$token |
Definition at line 302 of file CSSJanus.php.
Referenced by __construct().