r85666 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85665‎ | r85666 | r85667 >
Date:07:40, 8 April 2011
Author:ialex
Status:deferred
Tags:
Comment:
* Use MWNamespace::getCanonicalName() instead of $wgCanonicalNamespaceNames
* Use $this->getTitle() instead SpecialPage::getTitleFor( 'FindSpam' )
Modified paths:
  • /trunk/extensions/FindSpam/FindSpam_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FindSpam/FindSpam_body.php
@@ -21,7 +21,7 @@
2222 */
2323 public function execute( $par ) {
2424 global $wgRequest, $wgOut, $wgLocalDatabases, $wgUser;
25 - global $wgConf, $wgCanonicalNamespaceNames, $wgLang;
 25+ global $wgConf, $wgLang;
2626
2727 $this->setHeaders();
2828
@@ -34,8 +34,7 @@
3535 $ip = $wgRequest->getText( 'ip' );
3636
3737 # Show form
38 - $self = SpecialPage::getTitleFor( 'FindSpam' );
39 - $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) );
 38+ $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl() ) );
4039 $form .= '<table><tr><td align="right">' . wfMsgHtml( 'findspam-ip' ) . '</td>';
4140 $form .= '<td>' . Xml::input( 'ip', 50, $ip ) . '</td></tr>';
4241 $form .= '<tr><td></td><td>' . Xml::submitButton( wfMsg( 'findspam-ok' ) ) . '</td></tr></table></form>';
@@ -63,7 +62,7 @@
6463 if ( $row->rc_namespace == 0 ){
6564 $title = $row->rc_title;
6665 } else {
67 - $title = $wgCanonicalNamespaceNames[$row->rc_namespace] . ':' .$row->rc_title;
 66+ $title = MWNamespace::getCanonicalName( $row->rc_namespace ) . ':' .$row->rc_title;
6867 }
6968 $encTitle = urlencode( $title );
7069 $url = "$baseUrl/wiki/$encTitle";
@@ -88,4 +87,4 @@
8988 $wgOut->addWikiText( $s.'<br />' );
9089 }
9190 }
92 -}
\ No newline at end of file
 91+}

Status & tagging log