Utility class used by CSSJanus that tokenizes and untokenizes things we want to protect from being janused.
More...
Utility class used by CSSJanus that tokenizes and untokenizes things we want to protect from being janused.
- Author
- Roan Kattouw
Definition at line 362 of file CSSJanus.php.
◆ __construct()
CSSJanus_Tokenizer::__construct |
( |
|
$regex, |
|
|
|
$token |
|
) |
| |
Constructor.
- Parameters
-
string | $regex | Regular expression whose matches to replace by a token. |
string | $token | Token |
Definition at line 371 of file CSSJanus.php.
References $regex, $token, array(), and token.
◆ detokenize()
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.
- Parameters
-
- Returns
- string Original string
Definition at line 402 of file CSSJanus.php.
References array(), and token.
◆ detokenizeCallback()
CSSJanus_Tokenizer::detokenizeCallback |
( |
|
$matches | ) |
|
|
private |
◆ tokenize()
CSSJanus_Tokenizer::tokenize |
( |
|
$str | ) |
|
Replace all occurrences of $regex in $str with a token and remember the original strings.
- Parameters
-
- Returns
- string Tokenized string
Definition at line 383 of file CSSJanus.php.
References array().
◆ tokenizeCallback()
CSSJanus_Tokenizer::tokenizeCallback |
( |
|
$matches | ) |
|
|
private |
◆ $originals
CSSJanus_Tokenizer::$originals |
|
private |
◆ $regex
CSSJanus_Tokenizer::$regex |
|
private |
◆ $token
CSSJanus_Tokenizer::$token |
The documentation for this class was generated from the following file: