X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCategoryViewer.php;h=f36c75800b924628d2cd8d829a13e476044448a8;hb=3c0dac36eb60dfc6b34770d90af675bad5f18c0b;hp=b95f274406d88ec483d8a8c009ece8c5c36106fc;hpb=9964ca1a390c446397dcd466916ffed356cdc3c9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index b95f274406..f36c75800b 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -67,7 +67,7 @@ class CategoryViewer extends ContextSource { /** @var Collation */ public $collation; - /** @var ImageGallery */ + /** @var ImageGalleryBase */ public $gallery; /** @var Category Category object for this page. */ @@ -108,7 +108,6 @@ class CategoryViewer extends ContextSource { * @return string HTML output */ public function getHTML() { - $this->showGallery = $this->getConfig()->get( 'CategoryMagicGallery' ) && !$this->getOutput()->mNoGallery; @@ -197,7 +196,11 @@ class CategoryViewer extends ContextSource { $link = null; Hooks::run( 'CategoryViewer::generateLink', [ $type, $title, $html, &$link ] ); if ( $link === null ) { - $link = Linker::link( $title, $html ); + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); + if ( $html !== null ) { + $html = new HtmlArmor( $html ); + } + $link = $linkRenderer->makeLink( $title, $html ); } if ( $isRedirect ) { $link = '' . $link . ''; @@ -626,29 +629,30 @@ class CategoryViewer extends ContextSource { * @return string HTML */ private function pagingLinks( $first, $last, $type = '' ) { - $prevLink = $this->msg( 'prev-page' )->text(); + $prevLink = $this->msg( 'prev-page' )->escaped(); + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); if ( $first != '' ) { $prevQuery = $this->query; $prevQuery["{$type}until"] = $first; unset( $prevQuery["{$type}from"] ); - $prevLink = Linker::linkKnown( + $prevLink = $linkRenderer->makeKnownLink( $this->addFragmentToTitle( $this->title, $type ), - $prevLink, + new HtmlArmor( $prevLink ), [], $prevQuery ); } - $nextLink = $this->msg( 'next-page' )->text(); + $nextLink = $this->msg( 'next-page' )->escaped(); if ( $last != '' ) { $lastQuery = $this->query; $lastQuery["{$type}from"] = $last; unset( $lastQuery["{$type}until"] ); - $nextLink = Linker::linkKnown( + $nextLink = $linkRenderer->makeKnownLink( $this->addFragmentToTitle( $this->title, $type ), - $nextLink, + new HtmlArmor( $nextLink ), [], $lastQuery ); @@ -735,10 +739,7 @@ class CategoryViewer extends ContextSource { // to refresh the incorrect category table entry -- which should be // quick due to the small number of entries. $totalcnt = $rescnt; - $category = $this->cat; - DeferredUpdates::addCallableUpdate( function () use ( $category ) { - $category->refreshCounts(); - } ); + 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,