Merge "Deoptimize SVG versions of enhanced recent changes collapse/show arrows"
[lhc/web/wiklou.git] / languages / LanguageConverter.php
index 3059b2e..bb5b49f 100644 (file)
@@ -236,7 +236,8 @@ class LanguageConverter {
                        $ret = $wgRequest->getVal( 'uselang' );
                }
 
-               return $this->mURLVariant = $this->validateVariant( $ret );
+               $this->mURLVariant = $this->validateVariant( $ret );
+               return $this->mURLVariant;
        }
 
        /**
@@ -269,7 +270,8 @@ class LanguageConverter {
                        $ret = $wgUser->getOption( 'language' );
                }
 
-               return $this->mUserVariant = $this->validateVariant( $ret );
+               $this->mUserVariant = $this->validateVariant( $ret );
+               return $this->mUserVariant;
        }
 
        /**
@@ -401,9 +403,9 @@ class LanguageConverter {
                        $startPos = $elementPos + strlen( $element );
 
                        // Translate any alt or title attributes inside the matched element
-                       if ( $element !== '' && preg_match( '/^(<[^>\s]*)\s([^>]*)(.*)$/', $element,
-                               $elementMatches ) )
-                       {
+                       if ( $element !== ''
+                               && preg_match( '/^(<[^>\s]*)\s([^>]*)(.*)$/', $element, $elementMatches )
+                       {
                                $attrs = Sanitizer::decodeTagAttributes( $elementMatches[2] );
                                $changed = false;
                                foreach ( array( 'title', 'alt' ) as $attrName ) {
@@ -489,21 +491,6 @@ class LanguageConverter {
                return $ret;
        }
 
-       /**
-        * Convert link text to all valid variants.
-        * In the first, this function only convert text outside the
-        * "-{" "}-" markups. Since the "{" and "}" are not allowed in
-        * titles, the text will get all converted always.
-        * So I removed this feature and deprecated the function.
-        *
-        * @param $text String: the text to be converted
-        * @return Array: variant => converted text
-        * @deprecated since 1.17 Use autoConvertToAllVariants() instead
-        */
-       public function convertLinkToAllVariants( $text ) {
-               return $this->autoConvertToAllVariants( $text );
-       }
-
        /**
         * Apply manual conversion rules.
         *
@@ -1442,8 +1429,8 @@ class ConverterRule {
                        }
                        /* for unidirectional array fill to convert tables */
                        if ( ( $manLevel[$v] == 'bidirectional' || $manLevel[$v] == 'unidirectional' )
-                               && isset( $unidtable[$v] ) )
-                       {
+                               && isset( $unidtable[$v] )
+                       {
                                if ( isset( $this->mConvTable[$v] ) ) {
                                        $this->mConvTable[$v] = array_merge( $this->mConvTable[$v], $unidtable[$v] );
                                } else {