r69883 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69882‎ | r69883 | r69884 >
Date:17:56, 25 July 2010
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Mark used $wgUser as global.
$wgLang of 2917 already marked as global in 2889. Ditto for $wgDeleteRevisionsLimit of 2927.
$wgContLangmarked as global twice in getAutosummary

Are you able to catch the global declared twice left?
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -2913,8 +2913,6 @@
29142914
29152915 // If the page has a history, insert a warning
29162916 if ( $hasHistory && !$confirm ) {
2917 - global $wgLang;
2918 -
29192917 $skin = $wgUser->getSkin();
29202918 $revisions = $this->estimateRevisionCount();
29212919 //FIXME: lego
@@ -2925,8 +2923,6 @@
29262924 );
29272925
29282926 if ( $bigHistory ) {
2929 - global $wgDeleteRevisionsLimit;
2930 -
29312927 $wgOut->wrapWikiMsg( "<div class='error'>\n$1\n</div>\n",
29322928 array( 'delete-warning-toobig', $wgLang->formatNum( $wgDeleteRevisionsLimit ) ) );
29332929 }
@@ -3123,7 +3119,7 @@
31243120 * Perform a deletion and output success or failure messages
31253121 */
31263122 public function doDelete( $reason, $suppress = false ) {
3127 - global $wgOut;
 3123+ global $wgOut, $wgUser;
31283124
31293125 $id = $this->mTitle->getArticleID( GAID_FOR_UPDATE );
31303126
@@ -4350,6 +4346,8 @@
43514347 * @return string An appropriate autosummary, or an empty string.
43524348 */
43534349 public static function getAutosummary( $oldtext, $newtext, $flags ) {
 4350+ global $wgContLang;
 4351+
43544352 # Decide what kind of autosummary is needed.
43554353
43564354 # Redirect autosummaries
@@ -4363,7 +4361,6 @@
43644362 # New page autosummaries
43654363 if ( $flags & EDIT_NEW && strlen( $newtext ) ) {
43664364 # If they're making a new article, give its text, truncated, in the summary.
4367 - global $wgContLang;
43684365
43694366 $truncatedtext = $wgContLang->truncate(
43704367 str_replace( "\n", ' ', $newtext ),
@@ -4377,7 +4374,6 @@
43784375 return wfMsgForContent( 'autosumm-blank' );
43794376 } elseif ( strlen( $oldtext ) > 10 * strlen( $newtext ) && strlen( $newtext ) < 500 ) {
43804377 # Removing more than 90% of the article
4381 - global $wgContLang;
43824378
43834379 $truncatedtext = $wgContLang->truncate(
43844380 $newtext,

Follow-up revisions

RevisionCommit summaryAuthorDate
r70020Partial revert of r69883. Broke page deletion because of missing global....siebrand17:23, 27 July 2010
r70026Finish fixing r69883platonides18:47, 27 July 2010

Comments

#Comment by Nikerabbit (talk | contribs)   17:22, 27 July 2010
$wgLang of 2917 already marked as global in 2889. Ditto for $wgDeleteRevisionsLimit of 2927.

Inside if clause...

#Comment by Siebrand (talk | contribs)   17:23, 27 July 2010

See follow-up rev. Nikrabbit suggested complete revert.

#Comment by Platonides (talk | contribs)   18:56, 27 July 2010

Oops! I hadn't taken that into account.

It is now fixed. Only this commit was affected, with a second problem fixed in r70026.

A similar problem existed in SpecialUserlogin.php, fixed in r70027

#Comment by Nikerabbit (talk | contribs)   21:31, 27 July 2010

Thanks for fixing those.

#Comment by Hashar (talk | contribs)   09:57, 21 November 2010

Assuming ok by now.

Status & tagging log