Merge "languages: Replace implicit Bugzilla bug numbers with Phab ones"
[lhc/web/wiklou.git] / languages / LanguageConverter.php
index 13ba7e8..2183c96 100644 (file)
@@ -18,6 +18,7 @@
  * @file
  * @ingroup Language
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * Base class for language conversion.
@@ -47,7 +48,9 @@ class LanguageConverter {
        ];
 
        public $mMainLanguageCode;
-       public $mVariants, $mVariantFallbacks, $mVariantNames;
+       public $mVariants;
+       public $mVariantFallbacks;
+       public $mVariantNames;
        public $mTablesLoaded = false;
        public $mTables;
        // 'bidirectional' 'unidirectional' 'disable' for each variant
@@ -412,8 +415,6 @@ class LanguageConverter {
                                                $attr = $this->recursiveConvertTopLevel( $attr, $toVariant );
                                        }
 
-                                       // Remove HTML tags to avoid disrupting the layout
-                                       $attr = preg_replace( '/<[^>]+>/', '', $attr );
                                        if ( $attr !== $attrs[$attrName] ) {
                                                $attrs[$attrName] = $attr;
                                                $changed = true;
@@ -488,7 +489,7 @@ class LanguageConverter {
        protected function applyManualConv( $convRule ) {
                // Use syntax -{T|zh-cn:TitleCN; zh-tw:TitleTw}- to custom
                // title conversion.
-               // Bug 24072: $mConvRuleTitle was overwritten by other manual
+               // T26072: $mConvRuleTitle was overwritten by other manual
                // rule(s) not for title, this breaks the title conversion.
                $newConvRuleTitle = $convRule->getTitle();
                if ( $newConvRuleTitle ) {
@@ -550,8 +551,8 @@ class LanguageConverter {
                        $variant = $this->getPreferredVariant();
                }
 
-               $cache = ObjectCache::newAccelerator( CACHE_NONE );
-               $key = wfMemcKey( 'languageconverter', 'namespace-text', $index, $variant );
+               $cache = MediaWikiServices::getInstance()->getLocalServerObjectCache();
+               $key = $cache->makeKey( 'languageconverter', 'namespace-text', $index, $variant );
                $nsVariantText = $cache->get( $key );
                if ( $nsVariantText !== false ) {
                        return $nsVariantText;