From: Liuxinyu970226 <541329866@qq.com> Date: Thu, 18 Aug 2016 00:47:05 +0000 (+0000) Subject: Revert "Use display name in category page subheadings if provided" X-Git-Tag: 1.31.0-rc.0~4918^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=59280c4c929dc9c073e48879d3d44d5e55499c1c;ds=sidebyside Revert "Use display name in category page subheadings if provided" This reverts commit 8ccde8984913896d59a3c2b529768cfe74100afd. For the reason, see T43720#2531092 Bug: T149510 Change-Id: Id1ace9599642a36b333c63eaeebab0537466e7bd --- diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 490f548135..8dd3f5c516 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -407,26 +407,11 @@ class CategoryViewer extends ContextSource { return $r; } - /** - * Return pretty name which is display name if given and different from prefix text or - * the unprefixed page name. - * - * @return string HTML safe name. - */ - function getPrettyPageNameHtml() { - $displayTitle = $this->getOutput()->getPageTitle(); - if ( $displayTitle === $this->getTitle()->getPrefixedText() ) { - return htmlspecialchars( $this->getTitle()->getText() ); - } else { - return $displayTitle; - } - } - /** * @return string */ function getPagesSection() { - $name = $this->getPrettyPageNameHtml(); + $ti = wfEscapeWikiText( $this->title->getText() ); # Don't show articles section if there are none. $r = ''; @@ -442,7 +427,7 @@ class CategoryViewer extends ContextSource { if ( $rescnt > 0 ) { $r = "
\n"; - $r .= '

' . $this->msg( 'category_header' )->rawParams( $name )->parse() . "

\n"; + $r .= '

' . $this->msg( 'category_header', $ti )->parse() . "

\n"; $r .= $countmsg; $r .= $this->getSectionPagingLinks( 'page' ); $r .= $this->formatList( $this->articles, $this->articles_start_char ); @@ -456,7 +441,6 @@ class CategoryViewer extends ContextSource { * @return string */ function getImageSection() { - $name = $this->getPrettyPageNameHtml(); $r = ''; $rescnt = $this->showGallery ? $this->gallery->count() : count( $this->imgsNoGallery ); $dbcnt = $this->cat->getFileCount(); @@ -466,7 +450,10 @@ class CategoryViewer extends ContextSource { if ( $rescnt > 0 ) { $r .= "
\n"; $r .= '

' . - $this->msg( 'category-media-header' )->rawParams( $name )->parse() . + $this->msg( + 'category-media-header', + wfEscapeWikiText( $this->title->getText() ) + )->text() . "

\n"; $r .= $countmsg; $r .= $this->getSectionPagingLinks( 'file' );