http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99765

Revision: 99765
Author:   ialex
Date:     2011-10-14 14:20:02 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
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

Modified Paths:
--------------
    trunk/phase3/includes/QueryPage.php

Modified: trunk/phase3/includes/QueryPage.php
===================================================================
--- trunk/phase3/includes/QueryPage.php 2011-10-14 12:55:32 UTC (rev 99764)
+++ trunk/phase3/includes/QueryPage.php 2011-10-14 14:20:02 UTC (rev 99765)
@@ -760,8 +760,8 @@
                if ( $title instanceof Title ) {
                        if ( $this->isCached() || $this->forceExistenceCheck() 
) {
                                $pageLink = $title->isKnown()
-                                       ? '<del>' . $skin->link( $title ) . 
'</del>'
-                                       : $skin->link(
+                                       ? '<del>' . Linker::link( $title ) . 
'</del>'
+                                       : Linker::link(
                                                $title,
                                                null,
                                                array(),
@@ -769,7 +769,7 @@
                                                array( 'broken' )
                                        );
                        } else {
-                               $pageLink = $skin->link(
+                               $pageLink = Linker::link(
                                        $title,
                                        null,
                                        array(),
@@ -777,10 +777,9 @@
                                        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 @@
         * 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 );
        }
 }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to