summaryrefslogtreecommitdiff
path: root/includes/libs/CSSJanus.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/libs/CSSJanus.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/libs/CSSJanus.php')
-rw-r--r--includes/libs/CSSJanus.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/includes/libs/CSSJanus.php b/includes/libs/CSSJanus.php
index 4ebbc497..fb1e9a4c 100644
--- a/includes/libs/CSSJanus.php
+++ b/includes/libs/CSSJanus.php
@@ -57,6 +57,7 @@ class CSSJanus {
'lookahead_not_open_brace' => null,
'lookahead_not_closing_paren' => null,
'lookahead_for_closing_paren' => null,
+ 'lookahead_not_letter' => '(?![a-zA-Z])',
'lookbehind_not_letter' => '(?<![a-zA-Z])',
'chars_within_selector' => '[^\}]*?',
'noflip_annotation' => '\/\*\s*@noflip\s*\*\/',
@@ -104,8 +105,8 @@ class CSSJanus {
$patterns['noflip_class'] = "/({$patterns['noflip_annotation']}{$patterns['chars_within_selector']}})/i";
$patterns['direction_ltr'] = "/({$patterns['direction']})ltr/i";
$patterns['direction_rtl'] = "/({$patterns['direction']})rtl/i";
- $patterns['left'] = "/{$patterns['lookbehind_not_letter']}(left){$patterns['lookahead_not_closing_paren']}{$patterns['lookahead_not_open_brace']}/i";
- $patterns['right'] = "/{$patterns['lookbehind_not_letter']}(right){$patterns['lookahead_not_closing_paren']}{$patterns['lookahead_not_open_brace']}/i";
+ $patterns['left'] = "/{$patterns['lookbehind_not_letter']}(left){$patterns['lookahead_not_letter']}{$patterns['lookahead_not_closing_paren']}{$patterns['lookahead_not_open_brace']}/i";
+ $patterns['right'] = "/{$patterns['lookbehind_not_letter']}(right){$patterns['lookahead_not_letter']}{$patterns['lookahead_not_closing_paren']}{$patterns['lookahead_not_open_brace']}/i";
$patterns['left_in_url'] = "/{$patterns['lookbehind_not_letter']}(left){$patterns['lookahead_for_closing_paren']}/i";
$patterns['right_in_url'] = "/{$patterns['lookbehind_not_letter']}(right){$patterns['lookahead_for_closing_paren']}/i";
$patterns['ltr_in_url'] = "/{$patterns['lookbehind_not_letter']}(ltr){$patterns['lookahead_for_closing_paren']}/i";
@@ -122,7 +123,7 @@ class CSSJanus {
/**
* Transform an LTR stylesheet to RTL
- * @param $css String: stylesheet to transform
+ * @param string $css stylesheet to transform
* @param $swapLtrRtlInURL Boolean: If true, swap 'ltr' and 'rtl' in URLs
* @param $swapLeftRightInURL Boolean: If true, swap 'left' and 'right' in URLs
* @return string Transformed stylesheet
@@ -304,8 +305,8 @@ class CSSJanus_Tokenizer {
/**
* Constructor
- * @param $regex string Regular expression whose matches to replace by a token.
- * @param $token string Token
+ * @param string $regex Regular expression whose matches to replace by a token.
+ * @param string $token Token
*/
public function __construct( $regex, $token ) {
$this->regex = $regex;
@@ -316,7 +317,7 @@ class CSSJanus_Tokenizer {
/**
* Replace all occurrences of $regex in $str with a token and remember
* the original strings.
- * @param $str String to tokenize
+ * @param string $str to tokenize
* @return string Tokenized string
*/
public function tokenize( $str ) {
@@ -335,7 +336,7 @@ class CSSJanus_Tokenizer {
/**
* Replace tokens with their originals. If multiple strings were tokenized, it's important they be
* detokenized in exactly the SAME ORDER.
- * @param $str String: previously run through tokenize()
+ * @param string $str previously run through tokenize()
* @return string Original string
*/
public function detokenize( $str ) {