From: Brian Wolff Date: Wed, 11 Oct 2017 20:29:05 +0000 (+0000) Subject: Fix inconsistent i18n escaping in category paging links. X-Git-Tag: 1.31.0-rc.0~1802^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=0ea88136d80a82815a15ec0ab7f8982f0fd33823;p=lhc%2Fweb%2Fwiklou.git Fix inconsistent i18n escaping in category paging links. prev-page and next-page were being escaped when they were a link, but not when they were plain text. They should be escaped in both cases. This issue was discovered with an experimental phan plugin I'm working on. Change-Id: I6caac76299b21a54cd7cb732ad93187e3d37c99e --- diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 9d692d71b3..f36c75800b 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -629,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 != '' ) { @@ -638,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; @@ -652,7 +652,7 @@ class CategoryViewer extends ContextSource { unset( $lastQuery["{$type}until"] ); $nextLink = $linkRenderer->makeKnownLink( $this->addFragmentToTitle( $this->title, $type ), - $nextLink, + new HtmlArmor( $nextLink ), [], $lastQuery );