X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FCategoryViewer.php;h=f36c75800b924628d2cd8d829a13e476044448a8;hp=0205d708cab4901f0382cfc433a9f32f8bb3a757;hb=a8379682a46a428320c88702c800a6107c015137;hpb=8ea7953ab57163a575a2ce02d5dbf862d7c9744a diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 0205d708ca..f36c75800b 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -108,7 +108,6 @@ class CategoryViewer extends ContextSource { * @return string HTML output */ public function getHTML() { - $this->showGallery = $this->getConfig()->get( 'CategoryMagicGallery' ) && !$this->getOutput()->mNoGallery; @@ -630,7 +629,7 @@ 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 != '' ) { @@ -639,13 +638,13 @@ class CategoryViewer extends ContextSource { unset( $prevQuery["{$type}from"] ); $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; @@ -653,7 +652,7 @@ class CategoryViewer extends ContextSource { unset( $lastQuery["{$type}until"] ); $nextLink = $linkRenderer->makeKnownLink( $this->addFragmentToTitle( $this->title, $type ), - $nextLink, + new HtmlArmor( $nextLink ), [], $lastQuery ); @@ -740,16 +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 ) { - # Avoid excess contention on the same category (T162121) - $dbw = wfGetDB( DB_MASTER ); - $name = __METHOD__ . ':' . md5( $this->mName ); - $scopedLock = $dbw->getScopedLockAndFlush( $name, __METHOD__, 1 ); - if ( $scopedLock ) { - $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,