r77305 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77304‎ | r77305 | r77306 >
Date:22:24, 25 November 2010
Author:reedy
Status:ok
Tags:
Comment:
More reversion of r77297, 2 of 2 commits to keep it readable in CR (hopefully)
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_DOM.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialComparePages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)
  • /trunk/phase3/maintenance/dumpTextPass.php (modified) (history)
  • /trunk/phase3/maintenance/orphans.php (modified) (history)
  • /trunk/phase3/maintenance/populateCategory.php (modified) (history)
  • /trunk/phase3/maintenance/reassignEdits.php (modified) (history)
  • /trunk/phase3/maintenance/tests/phpunit/includes/UploadFromUrlTest.php (modified) (history)
  • /trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/UploadFromUrlTest.php
@@ -133,7 +133,6 @@
134134 $this->assertTrue( $exception, "Got exception" );
135135
136136 self::$user->addGroup( 'sysop' );
137 - $exception = false;
138137 $data = $this->doApiRequest( array(
139138 'action' => 'upload',
140139 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png',
Index: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php
@@ -303,7 +303,6 @@
304304 global $wgUser;
305305 $wgUser = self::$users['uploader']->user;
306306
307 - $extension = 'png';
308307 $mimeType = 'image/png';
309308
310309 $filePath = tempnam( wfTempDir(), "" );
@@ -617,7 +616,7 @@
618617 $hash = File::sha1Base36( $filePath );
619618 $dupes = RepoGroup::singleton()->findBySha1( $hash );
620619 $success = true;
621 - foreach ( $dupes as $key => $dupe ) {
 620+ foreach ( $dupes as $dupe ) {
622621 $success &= $this->deleteFileByTitle( $dupe->getTitle() );
623622 }
624623 return $success;
Index: trunk/phase3/maintenance/populateCategory.php
@@ -66,7 +66,6 @@
6767
6868 $maxlag = intval( $maxlag );
6969 $throttle = intval( $throttle );
70 - $force = (bool)$force;
7170 if ( $begin !== '' ) {
7271 $where = 'cl_to > ' . $dbw->addQuotes( $begin );
7372 } else {
Index: trunk/phase3/maintenance/reassignEdits.php
@@ -108,7 +108,7 @@
109109 # Update recent changes if required
110110 if ( $rc ) {
111111 $this->output( "Updating recent changes..." );
112 - $res = $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ), $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ );
 112+ $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ), $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ );
113113 $this->output( "done.\n" );
114114 }
115115 }
Index: trunk/phase3/maintenance/orphans.php
@@ -165,7 +165,6 @@
166166 $dbw = wfGetDB( DB_MASTER );
167167 $page = $dbw->tableName( 'page' );
168168 $revision = $dbw->tableName( 'revision' );
169 - $text = $dbw->tableName( 'text' );
170169
171170 if ( $fix ) {
172171 $dbw->lockTables( $dbw, 'text', __METHOD__ );
Index: trunk/phase3/maintenance/dumpTextPass.php
@@ -263,7 +263,6 @@
264264 while ( true ) {
265265 try {
266266 $text = $this->getTextDb( $id );
267 - $ex = new MWException( "Graceful storage failure" );
268267 } catch ( DBQueryError $ex ) {
269268 $text = false;
270269 }
Index: trunk/phase3/includes/upload/UploadBase.php
@@ -340,7 +340,7 @@
341341 protected function verifyFile() {
342342 # get the title, even though we are doing nothing with it, because
343343 # we need to populate mFinalExtension
344 - $nt = $this->getTitle();
 344+ $this->getTitle();
345345
346346 $this->mFileProps = File::getPropsFromPath( $this->mTempPath, $this->mFinalExtension );
347347 $this->checkMacBinary();
Index: trunk/phase3/includes/parser/Parser.php
@@ -789,7 +789,6 @@
790790 wfProfileIn( __METHOD__ );
791791
792792 $lines = StringUtils::explode( "\n", $text );
793 - $text = null;
794793 $out = '';
795794 $td_history = array(); # Is currently a td tag open?
796795 $last_tag_history = array(); # Save history of last lag activated (td, th or caption)
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php
@@ -511,9 +511,7 @@
512512 // another heading. Infinite loops are avoided because the next iteration MUST
513513 // hit the heading open case above, which unconditionally increments the
514514 // input pointer.
515 - }
516 -
517 - elseif ( $found == 'open' ) {
 515+ } elseif ( $found == 'open' ) {
518516 # count opening brace characters
519517 $count = strspn( $text, $curChar, $i );
520518
@@ -536,9 +534,7 @@
537535 $accum .= htmlspecialchars( str_repeat( $curChar, $count ) );
538536 }
539537 $i += $count;
540 - }
541 -
542 - elseif ( $found == 'close' ) {
 538+ } elseif ( $found == 'close' ) {
543539 $piece = $stack->top;
544540 # lets check if there are enough characters for closing brace
545541 $maxCount = $piece->count;
@@ -961,7 +957,9 @@
962958 $iteratorStack[$level] = false;
963959 }
964960
965 - if ( $contextNode instanceof PPNode_DOM ) $contextNode = $contextNode->node;
 961+ if ( $contextNode instanceof PPNode_DOM ) {
 962+ $contextNode = $contextNode->node;
 963+ }
966964
967965 $newIterator = false;
968966
Index: trunk/phase3/includes/Title.php
@@ -3302,7 +3302,6 @@
33033303 # Truncate for whole multibyte characters. +5 bytes for ellipsis
33043304 $comment = $wgContLang->truncate( $comment, 250 );
33053305
3306 - $newid = $nt->getArticleID();
33073306 $oldid = $this->getArticleID();
33083307 $latest = $this->getLatestRevId();
33093308
Index: trunk/phase3/includes/SkinTemplate.php
@@ -358,7 +358,6 @@
359359
360360 if( $wgPageShowWatchingUsers ) {
361361 $dbr = wfGetDB( DB_SLAVE );
362 - $watchlist = $dbr->tableName( 'watchlist' );
363362 $res = $dbr->select( 'watchlist',
364363 array( 'COUNT(*) AS n' ),
365364 array( 'wl_title' => $dbr->strencode( $this->mTitle->getDBkey() ), 'wl_namespace' => $this->mTitle->getNamespace() ),
Index: trunk/phase3/includes/specials/SpecialComparePages.php
@@ -97,7 +97,6 @@
9898 $this->form();
9999
100100 if( $this->opts->getValue( 'rev1' ) && $this->opts->getValue( 'rev2' ) ) {
101 - $title = Title::newFromText( $this->opts->getValue( 'page2' ) );
102101 $de = new DifferenceEngine( null,
103102 $this->opts->getValue( 'rev1' ),
104103 $this->opts->getValue( 'rev2' ),
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -176,7 +176,6 @@
177177 $wgOut->addWikiMsg( 'accmailtext', $u->getName(), $u->getEmail() );
178178 $wgOut->returnToMain( false );
179179 }
180 - $u = 0;
181180 }
182181
183182 /**
@@ -620,7 +619,7 @@
621620 }
622621
623622 wfDebug( __METHOD__ . ": creating account\n" );
624 - $user = $this->initUser( $user, true );
 623+ $this->initUser( $user, true );
625624 return self::SUCCESS;
626625 }
627626
Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -342,9 +342,9 @@
343343 global $wgOut;
344344 // Figure out the active search profile header
345345 $nsAllSet = array_keys( SearchEngine::searchableNamespaces() );
346 - if( $this->searchAdvanced )
 346+ if( $this->searchAdvanced ) {
347347 $this->active = 'advanced';
348 - else {
 348+ } else {
349349 $profiles = $this->getSearchProfiles();
350350
351351 foreach( $profiles as $key => $data ) {
@@ -416,7 +416,6 @@
417417 if( !is_null($infoLine) ) {
418418 $out .= "\n<!-- {$infoLine} -->\n";
419419 }
420 - $off = $this->offset + 1;
421420 $out .= "<ul class='mw-search-results'>\n";
422421 while( $result = $matches->next() ) {
423422 $out .= $this->showHit( $result, $terms );
@@ -623,7 +622,6 @@
624623
625624 $out = "<div id='mw-search-interwiki'><div id='mw-search-interwiki-caption'>".
626625 wfMsg('search-interwiki-caption')."</div>\n";
627 - $off = $this->offset + 1;
628626 $out .= "<ul class='mw-search-iwresults'>\n";
629627
630628 // work out custom project captions

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77297revert r76464...hashar20:01, 25 November 2010

Status & tagging log