From: Antoine Musso Date: Mon, 8 Sep 2008 22:08:39 +0000 (+0000) Subject: Partially fix #15528. Use Linker::link() from r40496 to deal with invalid X-Git-Tag: 1.31.0-rc.0~45406 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=23d598470a008794e74c2015f7ea75cefa634ad6;p=lhc%2Fweb%2Fwiklou.git Partially fix #15528. Use Linker::link() from r40496 to deal with invalid titles that might be present in database. --- diff --git a/includes/specials/SpecialDisambiguations.php b/includes/specials/SpecialDisambiguations.php index 34045660ff..a29111c474 100644 --- a/includes/specials/SpecialDisambiguations.php +++ b/includes/specials/SpecialDisambiguations.php @@ -87,10 +87,10 @@ class DisambiguationsPage extends PageQueryPage { $title = Title::newFromId( $result->value ); $dp = Title::makeTitle( $result->namespace, $result->title ); - $from = $skin->makeKnownLinkObj( $title, '' ); - $edit = $skin->makeKnownLinkObj( $title, "(".wfMsgHtml("qbedit").")" , 'redirect=no&action=edit' ); + $from = $skin->link( $title ); + $edit = $skin->link( $title, "(".wfMsgHtml("qbedit").")", array(), array( 'redirect' => 'no', 'action' => 'edit' ) ); $arr = $wgContLang->getArrow(); - $to = $skin->makeKnownLinkObj( $dp, '' ); + $to = $skin->link( $dp ); return "$from $edit $arr $to"; } diff --git a/includes/specials/SpecialMostcategories.php b/includes/specials/SpecialMostcategories.php index e6810999b5..1ba0562690 100644 --- a/includes/specials/SpecialMostcategories.php +++ b/includes/specials/SpecialMostcategories.php @@ -39,9 +39,9 @@ class MostcategoriesPage extends QueryPage { function formatResult( $skin, $result ) { global $wgLang; $title = Title::makeTitleSafe( $result->namespace, $result->title ); - if ( !$title instanceof Title ) { throw new MWException('Invalid title in database'); } + $count = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->value ) ); - $link = $skin->makeKnownLinkObj( $title, $title->getText() ); + $link = $skin->link( $title ); return wfSpecialList( $link, $count ); } } diff --git a/includes/specials/SpecialMostlinkedtemplates.php b/includes/specials/SpecialMostlinkedtemplates.php index d597a4e005..2d398a3810 100644 --- a/includes/specials/SpecialMostlinkedtemplates.php +++ b/includes/specials/SpecialMostlinkedtemplates.php @@ -92,15 +92,12 @@ class SpecialMostlinkedtemplates extends QueryPage { */ public function formatResult( $skin, $result ) { $title = Title::makeTitleSafe( $result->namespace, $result->title ); - if( $title instanceof Title ) { - return wfSpecialList( - $skin->makeLinkObj( $title ), - $this->makeWlhLink( $title, $skin, $result ) - ); - } else { - $tsafe = htmlspecialchars( $result->title ); - return "Invalid title in result set; {$tsafe}"; - } + + $skin->link( $title ); + return wfSpecialList( + $skin->makeLinkObj( $title ), + $this->makeWlhLink( $title, $skin, $result ) + ); } /** @@ -115,8 +112,8 @@ class SpecialMostlinkedtemplates extends QueryPage { global $wgLang; $wlh = SpecialPage::getTitleFor( 'Whatlinkshere' ); $label = wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ), - $wgLang->formatNum( $result->value ) ); - return $skin->makeKnownLinkObj( $wlh, $label, 'target=' . $title->getPrefixedUrl() ); + $wgLang->formatNum( $result->value ) ); + return $skin->link( $wlh, $label, array(), array( 'target' => $title->getPrefixedText() ) ); } }