CSSJanus
Convert CSS stylesheets between left-to-right and right-to-left.
|
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. | |
tokenize ( $str) | |
Replace all occurrences of $regex in $str with a token and remember the original strings. | |
detokenize ( $str) | |
Replace tokens with their originals. | |
Utility class used by CSSJanus that tokenizes and untokenizes things we want to protect from being janused.
CSSJanusTokenizer::__construct | ( | $regex, | |
$token | |||
) |
Constructor.
string | $regex | Regular expression whose matches to replace by a token. |
string | $token | Token |
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() |
CSSJanusTokenizer::tokenize | ( | $str | ) |
Replace all occurrences of $regex in $str with a token and remember the original strings.
string | $str | to tokenize |