From 0ea88136d80a82815a15ec0ab7f8982f0fd33823 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Wed, 11 Oct 2017 20:29:05 +0000 Subject: [PATCH] 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 --- includes/CategoryViewer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 ); -- 2.20.1