(bug 13913) Special:Whatlinkshere now has correct HTML markup
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 1 May 2008 18:36:08 +0000 (18:36 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 1 May 2008 18:36:08 +0000 (18:36 +0000)
RELEASE-NOTES
includes/SpecialWhatlinkshere.php

index ec7ed2b..2bc9570 100644 (file)
@@ -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 ===
index f1962f0..c1eb456 100644 (file)
@@ -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() {