X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCategoryViewer.php;h=4c4b8bbc874f54a31936d3457586023ac1410b07;hb=ce079cf6ad79ca8d3360817f809b219d166f9153;hp=c858dd7164f9b611e9c1f193dc449d5fce63193b;hpb=85ee6b473eac9dee92bf9784c5672864ed760f4f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index c858dd7164..4c4b8bbc87 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -197,7 +197,11 @@ class CategoryViewer extends ContextSource { $link = null; Hooks::run( 'CategoryViewer::generateLink', [ $type, $title, $html, &$link ] ); if ( $link === null ) { - $link = Linker::link( $title, $html ); + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); + if ( $html !== null ) { + $html = new HtmlArmor( $html ); + } + $link = $linkRenderer->makeLink( $title, $html ); } if ( $isRedirect ) { $link = '' . $link . ''; @@ -422,26 +426,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 = ''; @@ -457,7 +446,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 ); @@ -471,7 +460,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(); @@ -481,7 +469,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' );