The BlobStoreFactory constructor needs an LBFactory
[lhc/web/wiklou.git] / includes / CategoryViewer.php
index f36c758..46a1473 100644 (file)
@@ -221,8 +221,6 @@ class CategoryViewer extends ContextSource {
         * @return string
         */
        function getSubcategorySortChar( $title, $sortkey ) {
-               global $wgContLang;
-
                if ( $title->getPrefixedText() == $sortkey ) {
                        $word = $title->getDBkey();
                } else {
@@ -231,7 +229,7 @@ class CategoryViewer extends ContextSource {
 
                $firstChar = $this->collation->getFirstLetter( $word );
 
-               return $wgContLang->convert( $firstChar );
+               return MediaWikiServices::getInstance()->getContentLanguage()->convert( $firstChar );
        }
 
        /**
@@ -242,7 +240,6 @@ class CategoryViewer extends ContextSource {
         * @param bool $isRedirect
         */
        function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
-               global $wgContLang;
                if ( $this->showGallery ) {
                        $flip = $this->flip['file'];
                        if ( $flip ) {
@@ -253,8 +250,8 @@ class CategoryViewer extends ContextSource {
                } else {
                        $this->imgsNoGallery[] = $this->generateLink( 'image', $title, $isRedirect );
 
-                       $this->imgsNoGallery_start_char[] = $wgContLang->convert(
-                               $this->collation->getFirstLetter( $sortkey ) );
+                       $this->imgsNoGallery_start_char[] = MediaWikiServices::getInstance()->
+                               getContentLanguage()->convert( $this->collation->getFirstLetter( $sortkey ) );
                }
        }
 
@@ -266,12 +263,10 @@ class CategoryViewer extends ContextSource {
         * @param bool $isRedirect
         */
        function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
-               global $wgContLang;
-
                $this->articles[] = $this->generateLink( 'page', $title, $isRedirect );
 
-               $this->articles_start_char[] = $wgContLang->convert(
-                       $this->collation->getFirstLetter( $sortkey ) );
+               $this->articles_start_char[] = MediaWikiServices::getInstance()->
+                       getContentLanguage()->convert( $this->collation->getFirstLetter( $sortkey ) );
        }
 
        function finaliseCategoryState() {
@@ -581,7 +576,7 @@ class CategoryViewer extends ContextSource {
 
                foreach ( $colContents as $char => $articles ) {
                        # Change space to non-breaking space to keep headers aligned
-                       $h3char = $char === ' ' ? ' ' : htmlspecialchars( $char );
+                       $h3char = $char === ' ' ? "\u{00A0}" : htmlspecialchars( $char );
 
                        $ret .= '<div class="mw-category-group"><h3>' . $h3char;
                        $ret .= "</h3>\n";
@@ -735,11 +730,7 @@ class CategoryViewer extends ContextSource {
                        $totalcnt = $dbcnt;
                } elseif ( $rescnt < $this->limit && !$fromOrUntil ) {
                        // Case 2: not sane, but salvageable.  Use the number of results.
-                       // Since there are fewer than 200, we can also take this opportunity
-                       // to refresh the incorrect category table entry -- which should be
-                       // quick due to the small number of entries.
                        $totalcnt = $rescnt;
-                       DeferredUpdates::addCallableUpdate( [ $this->cat, 'refreshCounts' ] );
                } else {
                        // Case 3: hopeless.  Don't give a total count at all.
                        // Messages: category-subcat-count-limited, category-article-count-limited,