r50036 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50035‎ | r50036 | r50037 >
Date:06:22, 29 April 2009
Author:demon
Status:ok
Tags:
Comment:
Kill some more $wgTitles
Modified paths:
  • /trunk/extensions/CanonicalHref/CanonicalHref.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ProblemPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_RefreshTab.php (modified) (history)
  • /trunk/extensions/SignDocument/SpecialCreateSignDocument.php (modified) (history)
  • /trunk/extensions/SisterSites/SisterSites.php (modified) (history)
  • /trunk/extensions/SpamRegex/SpamRegexCore.php (modified) (history)
  • /trunk/extensions/TodoTasks/SpecialTaskList_body.php (modified) (history)
  • /trunk/extensions/WhiteList/WhiteListAuth.php (modified) (history)
  • /trunk/extensions/WhiteList/WhiteListEdit.php (modified) (history)
  • /trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CanonicalHref/CanonicalHref.php
@@ -22,14 +22,9 @@
2323
2424
2525 function canonicalHref(&$skin, &$template){
26 - global $wgTitle;
27 - if (!is_object($wgTitle) || !method_exists($wgTitle, "getFullURL")){
28 - // Avoid a fatal error if for any reason $wgTitle isn't an object
29 - return true;
30 - }
3126 $link = Xml::element("link", array(
3227 'rel' => 'canonical',
33 - 'href' => $wgTitle->getFullURL()
 28+ 'href' => $skin->mTitle->getFullURL()
3429 )
3530 );
3631 $template->set('headlinks', $template->data['headlinks'] . "\n" . $link . "\n");
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_RefreshTab.php
@@ -16,14 +16,14 @@
1717 * Adds an action that refreshes the article, i.e. it purges the article from
1818 * the cache and thus refreshes the inline queries.
1919 */
20 -function smwfAddRefreshTab($obj, $content_actions) {
21 - global $wgUser, $wgTitle;
 20+function smwfAddRefreshTab($skin, $content_actions) {
 21+ global $wgUser;
2222 if($wgUser->isAllowed('delete')){
2323 wfLoadExtensionMessages('SemanticMediaWiki');
2424 $content_actions['purge'] = array(
2525 'class' => false,
2626 'text' => wfMsg('smw_purge'),
27 - 'href' => $wgTitle->getLocalUrl( 'action=purge' )
 27+ 'href' => $skin->mTitle->getLocalUrl( 'action=purge' )
2828 );
2929 }
3030 return true; // always return true, in order not to stop MW's hook processing!
Index: trunk/extensions/SisterSites/SisterSites.php
@@ -17,11 +17,8 @@
1818
1919 function wfSisterDisplay( $out ) {
2020 if( $out->isArticleRelated() ) {
21 - global $wgTitle;
22 - $title = $wgTitle;
23 -
2421 $sister = new SisterSitesList();
25 - $matches = $sister->siblings( $title );
 22+ $matches = $sister->siblings( $out->getTitle() );
2623
2724 if( $matches ) {
2825 $out->addHTML( wfSisterList( $matches ) );
Index: trunk/extensions/WhiteList/WhiteListAuth.php
@@ -323,7 +323,7 @@
324324 } /* End class */
325325
326326 class WhiteListHooks {
327 - function AddRestrictedPagesTab(&$personal_urls, $wgTitle)
 327+ function AddRestrictedPagesTab(&$personal_urls, $title )
328328 {
329329 global $wgUser, $wgWhiteListRestrictedGroup;
330330
Index: trunk/extensions/WhiteList/WhiteListEdit.php
@@ -110,8 +110,8 @@
111111 return WhiteListExec::CheckWhiteList($title, $uwUser, $action, $result);
112112 }
113113
114 -function WL_doAddRestrictedPagesTab(&$personal_urls, $wgTitle) {
115 - return WhiteListHooks::AddRestrictedPagesTab($personal_urls, $wgTitle);
 114+function WL_doAddRestrictedPagesTab(&$personal_urls, $title ) {
 115+ return WhiteListHooks::AddRestrictedPagesTab($personal_urls, $title );
116116 }
117117
118118 // TODO - this is missing from Siebrand's changes
Index: trunk/extensions/SpamRegex/SpamRegexCore.php
@@ -6,7 +6,7 @@
77 class SpamRegexHooks {
88
99 public static function onEditFilter( $editpage ) {
10 - global $wgOut, $wgTitle;
 10+ global $wgOut;
1111 wfProfileIn( __METHOD__ );
1212
1313 // here we get only the phrases for blocking in summaries...
@@ -28,7 +28,7 @@
2929 $wgOut->addWikiMsg( 'spamprotectionmatch', "<nowiki>{$s_matches[0]}</nowiki>" );
3030 $wgOut->addWikiMsg( 'spamregex-summary' );
3131
32 - $wgOut->returnToMain( false, $wgTitle );
 32+ $wgOut->returnToMain( false, $editpage->mTitle );
3333 wfProfileOut( __METHOD__ );
3434 return false;
3535 }
Index: trunk/extensions/SignDocument/SpecialCreateSignDocument.php
@@ -33,12 +33,12 @@
3434 }
3535
3636 function buildCreateForm() {
37 - global $wgOut, $wgGroupPermissions, $wgTitle;
 37+ global $wgOut, $wgGroupPermissions;
3838
3939 $wgOut->addWikiText( wfMsg( 'createsigndoc-head' ) );
4040
4141 $wgOut->addHTML('
42 - <form action="'. $wgTitle->escapeLocalUrl() .'" method="post">
 42+ <form action="'. $this->getTitle()->escapeLocalUrl() .'" method="post">
4343 <table><tr><td>
4444 <strong>' . wfMsg( 'createsigndoc-pagename' ) . '&nbsp;</strong>
4545 </td><td>
Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php
@@ -236,9 +236,9 @@
237237 # If its not being fed by feedBurner, do it ourselves!
238238 if ( !array_key_exists( 'href', $rssArr ) || !$rssArr['href'] ) {
239239
240 - global $wgServer, $wgScript, $wgTitle;
 240+ global $wgServer, $wgScript;
241241
242 - $baseUrl = $wgServer . $wgScript . '?title=' . $wgTitle->getDBkey() . '&action=feed&feed=';
 242+ $baseUrl = $wgServer . $wgScript . '?title=' . $out->getTitle()->getDBkey() . '&action=feed&feed=';
243243 $rssArr['href'] = $baseUrl . 'rss';
244244 $atomArr['href'] = $baseUrl . 'atom';
245245 }
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -353,7 +353,7 @@
354354 * enables linkback and autocomplete for search
355355 */
356356 function mvfAutoAllPageHeader() {
357 - global $mvgScriptPath, $wgJsMimeType, $wgOut, $mvExtraHeader, $wgTitle, $mvgJSDebug, $wgEnableScriptLoader, $wgRequest, $wgScriptPath;
 357+ global $mvgScriptPath, $wgJsMimeType, $wgOut, $mvExtraHeader, $mvgJSDebug, $wgEnableScriptLoader, $wgRequest, $wgScriptPath;
358358
359359 $mvgScriptPath = htmlspecialchars( $mvgScriptPath );
360360 $wgJsMimeType = htmlspecialchars( $wgJsMimeType ) ;
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemPages_body.php
@@ -37,11 +37,11 @@
3838 }
3939
4040 protected function showForm() {
41 - global $wgOut, $wgTitle, $wgScript, $wgFlaggedRevsNamespaces;
 41+ global $wgOut, $wgScript, $wgFlaggedRevsNamespaces;
4242 $form = Xml::openElement( 'form',
4343 array( 'name' => 'reviewedpages', 'action' => $wgScript, 'method' => 'get' ) );
4444 $form .= "<fieldset><legend>".wfMsgHtml('problempages-leg')."</legend>\n";
45 - $form .= Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() );
 45+ $form .= Xml::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
4646 if( count($wgFlaggedRevsNamespaces) > 1 ) {
4747 $form .= FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . '&nbsp;';
4848 }
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -278,7 +278,7 @@
279279 * Show revision review form
280280 */
281281 private function showRevision() {
282 - global $wgOut, $wgUser, $wgTitle, $wgFlaggedRevComments;
 282+ global $wgOut, $wgUser, $wgFlaggedRevComments;
283283
284284 if( $this->unapprovedTags )
285285 $wgOut->addWikiText( '<strong>' . wfMsg( 'revreview-toolow' ) . '</strong>' );
@@ -301,7 +301,7 @@
302302 if( FlaggedRevs::showStableByDefault() )
303303 $wgOut->addWikiText( wfMsg('revreview-text') );
304304
305 - $action = $wgTitle->escapeLocalUrl( 'action=submit' );
 305+ $action = $this->getTitle()->escapeLocalUrl( 'action=submit' );
306306 $form = "<form name='RevisionReview' action='$action' method='post'>";
307307 $form .= '<fieldset><legend>' . wfMsgHtml( 'revreview-legend' ) . '</legend><table><tr>';
308308
Index: trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php
@@ -64,11 +64,11 @@
6565 }
6666
6767 private function showForm() {
68 - global $wgOut, $wgTitle, $wgScript;
 68+ global $wgOut, $wgScript;
6969 $wgOut->addHTML(
7070 Xml::openElement( 'form', array('name' => 'qualityoversight','action' => $wgScript,'method' => 'get') ) .
7171 '<fieldset><legend>' . wfMsgHtml('qualityoversight-legend') . '</legend><p>' .
72 - Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ) .
 72+ Xml::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) .
7373 FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . '&nbsp;' .
7474 ( FlaggedRevs::qualityVersions() ?
7575 FlaggedRevsXML::getLevelMenu( $this->level, 'revreview-filter-all', 1 ) . '&nbsp;'
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php
@@ -30,7 +30,7 @@
3131 }
3232
3333 public function showForm() {
34 - global $wgOut, $wgTitle, $wgScript, $wgFlaggedRevsNamespaces;
 34+ global $wgOut, $wgScript, $wgFlaggedRevsNamespaces;
3535
3636 $form = Xml::openElement( 'form',
3737 array( 'name' => 'reviewedpages', 'action' => $wgScript, 'method' => 'get' ) );
@@ -51,7 +51,7 @@
5252 $form .= $showhideredirs . ' ';
5353
5454 $form .= " ".Xml::submitButton( wfMsg( 'go' ) );
55 - $form .= Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() );
 55+ $form .= Xml::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
5656 $form .= "</fieldset></form>\n";
5757
5858 $wgOut->addHTML( $form );
Index: trunk/extensions/TodoTasks/SpecialTaskList_body.php
@@ -194,7 +194,7 @@
195195 return $text;
196196 }
197197
198 -function addPersonalUrl(&$personal_urls, $wgTitle)
 198+function addPersonalUrl( &$personal_urls, $title )
199199 {
200200 global $wgOut, $wgUser;
201201

Status & tagging log