From 465dc8bfc528571bdec6f1fdf3322957510cd999 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 1 May 2008 18:36:08 +0000 Subject: [PATCH] (bug 13913) Special:Whatlinkshere now has correct HTML markup --- RELEASE-NOTES | 1 + includes/SpecialWhatlinkshere.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ec7ed2bfef..2bc9570d1a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -232,6 +232,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13891) Show categories box even if all categories are hidden and user has "show hidden categories" option on * (bug 13915) Undefined variable $wltsfield in includes/SpecialWatchlist.php +* (bug 13913) Special:Whatlinkshere now has correct HTML markup === API changes in 1.13 === diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php index f1962f0777..c1eb4565c4 100644 --- a/includes/SpecialWhatlinkshere.php +++ b/includes/SpecialWhatlinkshere.php @@ -212,10 +212,12 @@ class WhatLinksHerePage { foreach ( $rows as $row ) { $nt = Title::makeTitle( $row->page_namespace, $row->page_title ); - $wgOut->addHTML( $this->listItem( $row, $nt ) ); - if ( $row->page_is_redirect && $level < 2 ) { + $wgOut->addHTML( $this->listItem( $row, $nt, true ) ); $this->showIndirectLinks( $level + 1, $nt, $wgMaxRedirectLinksRetrieved ); + $wgOut->addHTML( Xml::closeElement( 'li' ) ); + } else { + $wgOut->addHTML( $this->listItem( $row, $nt ) ); } } @@ -230,7 +232,7 @@ class WhatLinksHerePage { return Xml::openElement( 'ul' ); } - protected function listItem( $row, $nt ) { + protected function listItem( $row, $nt, $notClose = false ) { # local message cache static $msgcache = null; if ( $msgcache === null ) { @@ -261,7 +263,9 @@ class WhatLinksHerePage { $wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] ); $wlh = Xml::wrapClass( "($wlhLink)", 'mw-whatlinkshere-tools' ); - return Xml::tags( 'li', null, "$link $propsText $wlh" ) . "\n"; + return $notClose ? + Xml::openElement( 'li' ) . "$link $propsText $wlh\n" : + Xml::tags( 'li', null, "$link $propsText $wlh" ) . "\n"; } protected function listEnd() { -- 2.20.1