From: Alexandre Emsenhuber Date: Fri, 14 Oct 2011 14:20:02 +0000 (+0000) Subject: In WantedQueryPage: X-Git-Tag: 1.31.0-rc.0~27114 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=82cc745a524bae7495e762cb444361a3faffd84a;p=lhc%2Fweb%2Fwiklou.git In WantedQueryPage: * Call Linker methods statically * Use $this->msg() to simplify parameter formatting and escaping * Link to Special:Whatlinkshere/Page instead of Special:Whatlinkshere?target=Page for consistency --- diff --git a/includes/QueryPage.php b/includes/QueryPage.php index c3c96dc23c..c119b8541a 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -760,8 +760,8 @@ abstract class WantedQueryPage extends QueryPage { if ( $title instanceof Title ) { if ( $this->isCached() || $this->forceExistenceCheck() ) { $pageLink = $title->isKnown() - ? '' . $skin->link( $title ) . '' - : $skin->link( + ? '' . Linker::link( $title ) . '' + : Linker::link( $title, null, array(), @@ -769,7 +769,7 @@ abstract class WantedQueryPage extends QueryPage { array( 'broken' ) ); } else { - $pageLink = $skin->link( + $pageLink = Linker::link( $title, null, array(), @@ -777,10 +777,9 @@ abstract class WantedQueryPage extends QueryPage { array( 'broken' ) ); } - return $this->getLang()->specialList( $pageLink, $this->makeWlhLink( $title, $skin, $result ) ); + return $this->getLang()->specialList( $pageLink, $this->makeWlhLink( $title, $result ) ); } else { - $tsafe = htmlspecialchars( $result->title ); - return wfMsgHtml( 'wantedpages-badtitle', $tsafe ); + return $this->msg( 'wantedpages-badtitle', $result->title )->escaped(); } } @@ -788,14 +787,12 @@ abstract class WantedQueryPage extends QueryPage { * Make a "what links here" link for a given title * * @param $title Title to make the link for - * @param $skin Skin object to use * @param $result Object: result row * @return string */ - private function makeWlhLink( $title, $skin, $result ) { - $wlh = SpecialPage::getTitleFor( 'Whatlinkshere' ); - $label = wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ), - $this->getLang()->formatNum( $result->value ) ); - return $skin->link( $wlh, $label, array(), array( 'target' => $title->getPrefixedText() ) ); + private function makeWlhLink( $title, $result ) { + $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedText() ); + $label = $this->msg( 'nlinks' )->numParams( $result->value )->escaped(); + return Linker::link( $wlh, $label ); } }