r49343 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49342‎ | r49343 | r49344 >
Date:15:41, 9 April 2009
Author:demon
Status:deferred
Tags:
Comment:
Kill some more $wgTitles where there's more sane titles to use.
Modified paths:
  • /trunk/extensions/ConfirmAccount/UserCredentials_body.php (modified) (history)
  • /trunk/extensions/Editcount/SpecialEditcount_body.php (modified) (history)
  • /trunk/extensions/EmergencyDeSysop/SpecialEmergencyDeSysop.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/UnstablePages_body.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/SpecialDeleteThread.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/SpecialMoveThread.php (modified) (history)
  • /trunk/extensions/LiquidThreads/pages/SpecialNewMessages.php (modified) (history)
  • /trunk/extensions/RandomInCategory/SpecialRandomincategory.body.php (modified) (history)
  • /trunk/extensions/Renameuser/SpecialRenameuser_body.php (modified) (history)
  • /trunk/extensions/SimpleSecurity/SimpleSecurity_body.php (modified) (history)
  • /trunk/extensions/TemplateLink/TemplateLink.body.php (modified) (history)
  • /trunk/extensions/Translate/TranslatePage.php (modified) (history)
  • /trunk/extensions/UnicodeConverter/UnicodeConverter_body.php (modified) (history)
  • /trunk/extensions/UserMerge/UserMerge_body.php (modified) (history)
  • /trunk/extensions/Wikidata/SpecialLanguages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php
@@ -27,7 +27,7 @@
2828 * @param mixed $par Parameter passed to the page
2929 */
3030 public function execute( $par ) {
31 - global $wgOut, $wgUser, $wgTitle, $wgRequest, $wgContLang, $wgLang;
 31+ global $wgOut, $wgUser, $wgRequest, $wgContLang, $wgLang;
3232 global $wgVersion, $wgMaxNameChars, $wgCapitalLinks;
3333
3434 $this->setHeaders();
@@ -66,7 +66,7 @@
6767
6868 $wgOut->addHTML( "
6969 <!-- Current contributions limit is " . RENAMEUSER_CONTRIBLIMIT . " -->" .
70 - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $wgTitle->getLocalUrl(), 'id' => 'renameuser' ) ) .
 70+ Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'renameuser' ) ) .
7171 Xml::openElement( 'fieldset' ) .
7272 Xml::element( 'legend', null, wfMsg( 'renameuser' ) ) .
7373 Xml::openElement( 'table', array( 'id' => 'mw-renameuser-table' ) ) .
Index: trunk/extensions/LiquidThreads/pages/SpecialDeleteThread.php
@@ -100,11 +100,11 @@
101101 }
102102
103103 function execute( $par ) {
104 - global $wgOut, $wgRequest, $wgTitle, $wgUser;
 104+ global $wgOut, $wgRequest, $wgUser;
105105 $this->user = $wgUser;
106106 $this->output = $wgOut;
107107 $this->request = $wgRequest;
108 - $this->title = $wgTitle;
 108+ $this->title = $this->getTitle();
109109
110110 $this->setHeaders();
111111
Index: trunk/extensions/LiquidThreads/pages/SpecialMoveThread.php
@@ -20,7 +20,7 @@
2121
2222 function handleGet() {
2323 wfLoadExtensionMessages( 'LiquidThreads' );
24 - $form_action = $this->title->getLocalURL() . '/' . $this->thread->title()->getPrefixedURL();
 24+ $form_action = $this->getTitle()->getLocalURL() . '/' . $this->thread->title()->getPrefixedURL();
2525 $thread_name = $this->thread->title()->getPrefixedText();
2626 $article_name = $this->thread->article()->getTitle()->getTalkPage()->getPrefixedText();
2727 $edit_url = LqtView::permalinkUrl( $this->thread, 'edit', $this->thread );
@@ -101,11 +101,10 @@
102102 }
103103
104104 function execute( $par ) {
105 - global $wgOut, $wgRequest, $wgTitle, $wgUser;
 105+ global $wgOut, $wgRequest, $wgUser;
106106 $this->user = $wgUser;
107107 $this->output = $wgOut;
108108 $this->request = $wgRequest;
109 - $this->title = $wgTitle;
110109
111110 $this->setHeaders();
112111
Index: trunk/extensions/LiquidThreads/pages/SpecialNewMessages.php
@@ -19,17 +19,16 @@
2020 }
2121
2222 function execute( $par ) {
23 - global $wgOut, $wgRequest, $wgTitle, $wgUser;
 23+ global $wgOut, $wgRequest, $wgUser;
2424 wfLoadExtensionMessages( 'LiquidThreads' );
2525 $this->user = $wgUser;
2626 $this->output = $wgOut;
2727 $this->request = $wgRequest;
28 - $this->title = $wgTitle;
2928
3029 $this->setHeaders();
3130
32 - $view = new NewUserMessagesView( $this->output, new Article( $this->title ),
33 - $this->title, $this->user, $this->request );
 31+ $view = new NewUserMessagesView( $this->output, new Article( $this->getTitle() ),
 32+ $this->getTitle(), $this->user, $this->request );
3433
3534 $view->showOnce(); // handles POST etc.
3635
Index: trunk/extensions/RandomInCategory/SpecialRandomincategory.body.php
@@ -105,7 +105,7 @@
106106 }
107107
108108 public static function getForm( $par = null ) {
109 - global $wgScript, $wgTitle, $wgRequest;
 109+ global $wgScript, $wgRequest;
110110
111111 if( !( $category = $par ) ) {
112112 $category = $wgRequest->getVal( 'category' );
@@ -115,7 +115,7 @@
116116 Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
117117 Xml::openElement( 'fieldset' ) .
118118 Xml::element( 'legend', array(), wfMsg( 'randomincategory' ) ) .
119 - Xml::hidden( 'title', $wgTitle->getPrefixedText() ) .
 119+ Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
120120 Xml::openElement( 'p' ) .
121121 Xml::label( wfMsg( 'randomincategory-label' ), 'category' ) . ' ' .
122122 Xml::input( 'category', null, $category, array( 'id' => 'category' ) ) . ' ' .
Index: trunk/extensions/SimpleSecurity/SimpleSecurity_body.php
@@ -90,14 +90,15 @@
9191 * Render security info if any restrictions on this title
9292 */
9393 public function onOutputPageBeforeHTML( &$out, &$text ) {
94 - global $wgTitle, $wgUser;
 94+ global $wgUser;
9595
 96+ $title = $out->getTitle();
9697 # Render security info if any
97 - if ( is_object( $wgTitle ) && $wgTitle->exists() && count( $this->info['LS'] ) + count( $this->info['PR'] ) ) {
 98+ if ( is_object( $title ) && $title->exists() && count( $this->info['LS'] ) + count( $this->info['PR'] ) ) {
9899
99100 $rights = $wgUser->getRights();
100 - $wgTitle->getRestrictions( false );
101 - $reqgroups = $wgTitle->mRestrictions;
 101+ $title->getRestrictions( false );
 102+ $reqgroups = $title->mRestrictions;
102103 $sysop = in_array( 'sysop', $wgUser->getGroups() );
103104
104105 # Build restrictions text
Index: trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php
@@ -24,7 +24,7 @@
2525 }
2626
2727 protected function showList( $wgRequest ) {
28 - global $wgOut, $wgScript, $wgTitle, $wgFlaggedRevsNamespaces;
 28+ global $wgOut, $wgScript, $wgFlaggedRevsNamespaces;
2929 # If no NS given, then just use the first of $wgFlaggedRevsNamespaces
3030 $defaultNS = empty($wgFlaggedRevsNamespaces) ? 0 : $wgFlaggedRevsNamespaces[0];
3131 $namespace = $wgRequest->getIntOrNull( 'namespace', $defaultNS );
@@ -43,7 +43,7 @@
4444 $action = htmlspecialchars( $wgScript );
4545 $wgOut->addHTML( "<form action=\"$action\" method=\"get\">\n" .
4646 '<fieldset><legend>' . wfMsg('unreviewed-legend') . '</legend>' .
47 - Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ) . '<p>' );
 47+ Xml::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . '<p>' );
4848 # Add dropdowns as needed
4949 if( count($wgFlaggedRevsNamespaces) > 1 ) {
5050 $wgOut->addHTML( FlaggedRevsXML::getNamespaceMenu( $namespace ) . '&nbsp;' );
Index: trunk/extensions/FlaggedRevs/specialpages/UnstablePages_body.php
@@ -25,14 +25,14 @@
2626 }
2727
2828 protected function showForm() {
29 - global $wgOut, $wgTitle, $wgScript, $wgFlaggedRevsNamespaces;
 29+ global $wgOut, $wgScript, $wgFlaggedRevsNamespaces;
3030 $wgOut->addHTML( wfMsgExt('unstablepages-text', array('parseinline') ) );
3131 if( count($wgFlaggedRevsNamespaces) > 1 ) {
3232 $form = Xml::openElement( 'form', array( 'name' => 'unstablepages', 'action' => $wgScript, 'method' => 'get' ) );
3333 $form .= "<fieldset><legend>".wfMsg('unstablepages')."</legend>\n";
3434 $form .= FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . '&nbsp;';
3535 $form .= " ".Xml::submitButton( wfMsg( 'go' ) );
36 - $form .= Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() );
 36+ $form .= Xml::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
3737 $form .= "</fieldset></form>\n";
3838 $wgOut->addHTML( $form );
3939 }
Index: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php
@@ -26,7 +26,7 @@
2727 }
2828
2929 protected function showForm() {
30 - global $wgOut, $wgTitle, $wgScript, $wgFlaggedRevsNamespaces;
 30+ global $wgOut, $wgScript, $wgFlaggedRevsNamespaces;
3131 $wgOut->addHTML( wfMsgExt('stablepages-text', array('parseinline') ) );
3232 if( count($wgFlaggedRevsNamespaces) > 1 ) {
3333 $form = Xml::openElement( 'form', array( 'name' => 'stablepages', 'action' => $wgScript, 'method' => 'get' ) );
@@ -35,7 +35,7 @@
3636 $form .= Xml::label( wfMsg('stablepages-precedence'), 'wpPrecedence' ) . '&nbsp;';
3737 $form .= FlaggedRevsXML::getPrecedenceMenu( $this->precedence ) . '&nbsp;';
3838 $form .= " ".Xml::submitButton( wfMsg( 'go' ) );
39 - $form .= Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() );
 39+ $form .= Xml::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
4040 $form .= "</fieldset></form>\n";
4141 $wgOut->addHTML( $form );
4242 }
Index: trunk/extensions/Editcount/SpecialEditcount_body.php
@@ -163,11 +163,11 @@
164164 $this->nscount = $nscount;
165165 $this->total = $total;
166166
167 - global $wgTitle, $wgOut, $wgLang;
 167+ global $wgOut, $wgLang;
168168
169169 $this->setHeaders();
170170
171 - $action = $wgTitle->escapeLocalUrl();
 171+ $action = $this->getTitle()->escapeLocalUrl();
172172 $user = wfMsgHtml( 'editcount_username' );
173173 $submit = wfMsgHtml( 'editcount_submit' );
174174 $out = "
Index: trunk/extensions/Translate/TranslatePage.php
@@ -319,9 +319,9 @@
320320
321321 private function makeOffsetLink( $label, $offset ) {
322322 wfMemIn( __METHOD__ );
323 - global $wgTitle, $wgUser;
 323+ global $wgUser;
324324 $skin = $wgUser->getSkin();
325 - $link = $skin->makeLinkObj( $wgTitle, $label,
 325+ $link = $skin->makeLinkObj( $this->getTitle(), $label,
326326 wfArrayToCGI(
327327 array( 'offset' => $offset ),
328328 $this->nondefaults
Index: trunk/extensions/Wikidata/SpecialLanguages.php
@@ -73,8 +73,8 @@
7474 # $wgRequest->getText( 'page' );
7575 }
7676 function showForm() {
77 - global $wgTitle, $wgOut;
78 - $action = $wgTitle->escapeLocalURL( 'action=submit' );
 77+ global $wgOut;
 78+ $action = $this->getTitle()->escapeLocalURL( 'action=submit' );
7979 $wgOut->addHTML(
8080 <<<END
8181 <form name="addlanguage" method="post" action="$action">
Index: trunk/extensions/EmergencyDeSysop/SpecialEmergencyDeSysop.php
@@ -112,9 +112,9 @@
113113 * This function shows the request form
114114 */
115115 function showForm() {
116 - global $wgRequest, $wgOut, $wgUser, $wgTitle;
 116+ global $wgRequest, $wgOut, $wgUser;
117117
118 - $action = $wgTitle->escapeLocalUrl();
 118+ $action = $this->getTitle()->escapeLocalUrl();
119119 $f = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'name' => 'request' ) );
120120
121121
Index: trunk/extensions/TemplateLink/TemplateLink.body.php
@@ -48,11 +48,11 @@
4949 }
5050
5151 function sandboxParse($wikiText){
52 - global $wgTitle, $wgUser;
 52+ global $wgUser;
5353 $myParser = new Parser();
5454 $myParserOptions = new ParserOptions();
5555 $myParserOptions->initialiseFromUser($wgUser);
56 - $result = $myParser->parse($wikiText, $wgTitle, $myParserOptions);
 56+ $result = $myParser->parse($wikiText, $this->getTitle(), $myParserOptions);
5757 return $result->getText();
5858 }
5959 }
Index: trunk/extensions/UserMerge/UserMerge_body.php
@@ -18,7 +18,7 @@
1919 }
2020
2121 function execute( $par ) {
22 - global $wgRequest, $wgOut, $wgUser, $wgTitle;
 22+ global $wgRequest, $wgOut, $wgUser;
2323
2424 wfLoadExtensionMessages( 'UserMerge' );
2525
@@ -111,7 +111,7 @@
112112 }
113113
114114 $wgOut->addHTML(
115 - Xml::openElement( 'form', array( 'method' => 'post', 'action' => $wgTitle->getLocalUrl(), 'id' => 'usermergeform' ) ) .
 115+ Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'usermergeform' ) ) .
116116 Xml::fieldset( wfMsg( 'usermerge-fieldset' ) ) .
117117 Xml::openElement( 'table', array( 'id' => 'mw-usermerge-table' ) ) .
118118 "<tr>
Index: trunk/extensions/ConfirmAccount/UserCredentials_body.php
@@ -43,13 +43,13 @@
4444 }
4545
4646 function showForm() {
47 - global $wgOut, $wgTitle, $wgScript;
 47+ global $wgOut, $wgScript;
4848
4949 $username = str_replace( '_', ' ', $this->target );
5050 $form = Xml::openElement( 'form', array( 'name' => 'stablization', 'action' => $wgScript, 'method' => 'get' ) );
5151 $form .= "<fieldset><legend>".wfMsg('usercredentials-leg')."</legend>";
5252 $form .= "<table><tr>";
53 - $form .= "<td>".Xml::hidden( 'title', $wgTitle->getPrefixedText() )."</td>";
 53+ $form .= "<td>".Xml::hidden( 'title', $this->getTitle()->getPrefixedText() )."</td>";
5454 $form .= "<td>".wfMsgHtml("usercredentials-user")."</td>";
5555 $form .= "<td>".Xml::input('target', 35, $username, array( 'id' => 'wpUsername' ) )."</td>";
5656 $form .= "<td>".Xml::submitButton( wfMsg( 'go' ) )."</td>";
Index: trunk/extensions/UnicodeConverter/UnicodeConverter_body.php
@@ -11,7 +11,7 @@
1212 }
1313
1414 function execute( $par ) {
15 - global $wgRequest, $wgOut, $wgTitle;
 15+ global $wgRequest, $wgOut;
1616
1717 wfLoadExtensionMessages( 'UnicodeConverter' );
1818
@@ -19,7 +19,7 @@
2020
2121 $q = $wgRequest->getText( 'q' );
2222 $encQ = htmlspecialchars( $q );
23 - $action = $wgTitle->escapeLocalUrl();
 23+ $action = $this->getTitle()->escapeLocalUrl();
2424 $ok = htmlspecialchars( wfMsg( 'unicodeconverter-ok' ) );
2525
2626 $wgOut->addHTML( <<<END

Status & tagging log