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
This commit is contained in:
Brian Wolff 2017-10-11 20:29:05 +00:00
parent 25a3f02bba
commit 0ea88136d8

View file

@ -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
);