Index: trunk/phase3/maintenance/tests/phpunit/includes/UploadFromUrlTest.php |
— | — | @@ -133,6 +133,7 @@ |
134 | 134 | $this->assertTrue( $exception, "Got exception" ); |
135 | 135 | |
136 | 136 | self::$user->addGroup( 'sysop' ); |
| 137 | + $exception = false; |
137 | 138 | $data = $this->doApiRequest( array( |
138 | 139 | 'action' => 'upload', |
139 | 140 | 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', |
Index: trunk/phase3/maintenance/tests/phpunit/includes/api/RandomImageGenerator.php |
— | — | @@ -203,7 +203,6 @@ |
204 | 204 | $args[] = $filename; |
205 | 205 | |
206 | 206 | $command = wfEscapeShellArg( $wgImageMagickConvertCommand ) . " " . implode( " ", $args ); |
207 | | - $retval = null; |
208 | 207 | $output = wfShellExec( $command, $retval ); |
209 | 208 | return ( $retval === 0 ); |
210 | 209 | } |
Index: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php |
— | — | @@ -303,6 +303,7 @@ |
304 | 304 | global $wgUser; |
305 | 305 | $wgUser = self::$users['uploader']->user; |
306 | 306 | |
| 307 | + $extension = 'png'; |
307 | 308 | $mimeType = 'image/png'; |
308 | 309 | |
309 | 310 | $filePath = tempnam( wfTempDir(), "" ); |
— | — | @@ -616,7 +617,7 @@ |
617 | 618 | $hash = File::sha1Base36( $filePath ); |
618 | 619 | $dupes = RepoGroup::singleton()->findBySha1( $hash ); |
619 | 620 | $success = true; |
620 | | - foreach ( $dupes as $dupe ) { |
| 621 | + foreach ( $dupes as $key => $dupe ) { |
621 | 622 | $success &= $this->deleteFileByTitle( $dupe->getTitle() ); |
622 | 623 | } |
623 | 624 | return $success; |
Index: trunk/phase3/maintenance/populateCategory.php |
— | — | @@ -66,6 +66,7 @@ |
67 | 67 | |
68 | 68 | $maxlag = intval( $maxlag ); |
69 | 69 | $throttle = intval( $throttle ); |
| 70 | + $force = (bool)$force; |
70 | 71 | if ( $begin !== '' ) { |
71 | 72 | $where = 'cl_to > ' . $dbw->addQuotes( $begin ); |
72 | 73 | } else { |
Index: trunk/phase3/maintenance/reassignEdits.php |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | # Update recent changes if required |
110 | 110 | if ( $rc ) { |
111 | 111 | $this->output( "Updating recent changes..." ); |
112 | | - $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ), $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ ); |
| 112 | + $res = $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ), $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ ); |
113 | 113 | $this->output( "done.\n" ); |
114 | 114 | } |
115 | 115 | } |
Index: trunk/phase3/maintenance/orphans.php |
— | — | @@ -165,6 +165,7 @@ |
166 | 166 | $dbw = wfGetDB( DB_MASTER ); |
167 | 167 | $page = $dbw->tableName( 'page' ); |
168 | 168 | $revision = $dbw->tableName( 'revision' ); |
| 169 | + $text = $dbw->tableName( 'text' ); |
169 | 170 | |
170 | 171 | if ( $fix ) { |
171 | 172 | $dbw->lockTables( $dbw, 'text', __METHOD__ ); |
Index: trunk/phase3/maintenance/dumpTextPass.php |
— | — | @@ -263,6 +263,7 @@ |
264 | 264 | while ( true ) { |
265 | 265 | try { |
266 | 266 | $text = $this->getTextDb( $id ); |
| 267 | + $ex = new MWException( "Graceful storage failure" ); |
267 | 268 | } catch ( DBQueryError $ex ) { |
268 | 269 | $text = false; |
269 | 270 | } |
Index: trunk/phase3/includes/upload/UploadBase.php |
— | — | @@ -340,7 +340,7 @@ |
341 | 341 | protected function verifyFile() { |
342 | 342 | # get the title, even though we are doing nothing with it, because |
343 | 343 | # we need to populate mFinalExtension |
344 | | - $this->getTitle(); |
| 344 | + $nt = $this->getTitle(); |
345 | 345 | |
346 | 346 | $this->mFileProps = File::getPropsFromPath( $this->mTempPath, $this->mFinalExtension ); |
347 | 347 | $this->checkMacBinary(); |
Index: trunk/phase3/includes/diff/WikiDiff.php |
— | — | @@ -313,7 +313,7 @@ |
314 | 314 | } |
315 | 315 | $matches = $ymatches[$line]; |
316 | 316 | reset($matches); |
317 | | - while ( list( , $y ) = each( $matches ) ) { |
| 317 | + while ( list( $junk, $y ) = each( $matches ) ) { |
318 | 318 | if ( empty( $this->in_seq[$y] ) ) { |
319 | 319 | $k = $this->_lcs_pos( $y ); |
320 | 320 | assert( $k > 0 ); |
— | — | @@ -321,7 +321,7 @@ |
322 | 322 | break; |
323 | 323 | } |
324 | 324 | } |
325 | | - while (list ( , $y) = each($matches)) { |
| 325 | + while (list ( /* $junk */, $y) = each($matches)) { |
326 | 326 | if ($y > $this->seq[$k-1]) { |
327 | 327 | assert($y < $this->seq[$k]); |
328 | 328 | // Optimization: this is a common case: |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -1473,6 +1473,7 @@ |
1474 | 1474 | global $wgOut; |
1475 | 1475 | |
1476 | 1476 | $oldid = $this->getOldID(); |
| 1477 | + $useParserCache = $this->useParserCache( $oldid ); |
1477 | 1478 | $parserOptions = $this->getParserOptions(); |
1478 | 1479 | |
1479 | 1480 | # Render printable version, use printable version cache |
Index: trunk/phase3/includes/MimeMagic.php |
— | — | @@ -826,7 +826,7 @@ |
827 | 827 | $m = trim( $m ); |
828 | 828 | $m = strtolower( $m ); |
829 | 829 | |
830 | | - if ( strpos( $m, 'unknown' ) === false ) { |
| 830 | + if ( strpos( $m, 'unknown' ) !== false ) { |
831 | 831 | $m = null; |
832 | 832 | } else { |
833 | 833 | wfDebug( __METHOD__.": magic mime type of $file: $m\n" ); |
Index: trunk/phase3/includes/parser/LinkHolderArray.php |
— | — | @@ -159,6 +159,7 @@ |
160 | 160 | $current = null; |
161 | 161 | foreach ( $this->internals as $ns => $entries ) { |
162 | 162 | foreach ( $entries as $index => $entry ) { |
| 163 | + $key = "$ns:$index"; |
163 | 164 | $title = $entry['title']; |
164 | 165 | $pdbk = $entry['pdbk']; |
165 | 166 | |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -789,6 +789,7 @@ |
790 | 790 | wfProfileIn( __METHOD__ ); |
791 | 791 | |
792 | 792 | $lines = StringUtils::explode( "\n", $text ); |
| 793 | + $text = null; |
793 | 794 | $out = ''; |
794 | 795 | $td_history = array(); # Is currently a td tag open? |
795 | 796 | $last_tag_history = array(); # Save history of last lag activated (td, th or caption) |
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php |
— | — | @@ -511,7 +511,9 @@ |
512 | 512 | // another heading. Infinite loops are avoided because the next iteration MUST |
513 | 513 | // hit the heading open case above, which unconditionally increments the |
514 | 514 | // input pointer. |
515 | | - } elseif ( $found == 'open' ) { |
| 515 | + } |
| 516 | + |
| 517 | + elseif ( $found == 'open' ) { |
516 | 518 | # count opening brace characters |
517 | 519 | $count = strspn( $text, $curChar, $i ); |
518 | 520 | |
— | — | @@ -534,7 +536,9 @@ |
535 | 537 | $accum .= htmlspecialchars( str_repeat( $curChar, $count ) ); |
536 | 538 | } |
537 | 539 | $i += $count; |
538 | | - } elseif ( $found == 'close' ) { |
| 540 | + } |
| 541 | + |
| 542 | + elseif ( $found == 'close' ) { |
539 | 543 | $piece = $stack->top; |
540 | 544 | # lets check if there are enough characters for closing brace |
541 | 545 | $maxCount = $piece->count; |
— | — | @@ -957,9 +961,7 @@ |
958 | 962 | $iteratorStack[$level] = false; |
959 | 963 | } |
960 | 964 | |
961 | | - if ( $contextNode instanceof PPNode_DOM ) { |
962 | | - $contextNode = $contextNode->node; |
963 | | - } |
| 965 | + if ( $contextNode instanceof PPNode_DOM ) $contextNode = $contextNode->node; |
964 | 966 | |
965 | 967 | $newIterator = false; |
966 | 968 | |
Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -331,6 +331,8 @@ |
332 | 332 | $height_orig = $this->displayImg->getHeight( $page ); |
333 | 333 | $height = $height_orig; |
334 | 334 | |
| 335 | + $showLink = false; |
| 336 | + $linkAttribs = array( 'href' => $full_url ); |
335 | 337 | $longDesc = $this->displayImg->getLongDesc(); |
336 | 338 | |
337 | 339 | wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this, &$wgOut ) ); |
— | — | @@ -1009,7 +1011,6 @@ |
1010 | 1012 | } |
1011 | 1013 | $row .= '</td>'; |
1012 | 1014 | |
1013 | | - $rowClass = null; |
1014 | 1015 | wfRunHooks( 'ImagePageFileHistoryLine', array( $this, $file, &$row, &$rowClass ) ); |
1015 | 1016 | $classAttr = $rowClass ? " class='$rowClass'" : ""; |
1016 | 1017 | |
Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -751,6 +751,7 @@ |
752 | 752 | return true; |
753 | 753 | } |
754 | 754 | return false; |
| 755 | + |
755 | 756 | } |
756 | 757 | |
757 | 758 | /** |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -1249,9 +1249,11 @@ |
1250 | 1250 | $join_conds ); |
1251 | 1251 | |
1252 | 1252 | // We must adjust for offset |
1253 | | - if ( isset( $options['LIMIT'] ) && isset ( $options['OFFSET'] ) ) { |
1254 | | - $limit = $options['LIMIT']; |
1255 | | - $offset = $options['OFFSET']; |
| 1253 | + if ( isset( $options['LIMIT'] ) ) { |
| 1254 | + if ( isset ( $options['OFFSET'] ) ) { |
| 1255 | + $limit = $options['LIMIT']; |
| 1256 | + $offset = $options['OFFSET']; |
| 1257 | + } |
1256 | 1258 | } |
1257 | 1259 | |
1258 | 1260 | // DB2 does not have a proper num_rows() function yet, so we must emulate |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -552,9 +552,9 @@ |
553 | 553 | */ |
554 | 554 | function nextSequenceValue( $seqName ) { |
555 | 555 | if ( !$this->tableExists( 'sequence_' . $seqName ) ) { |
556 | | - sqlsrv_query( $this->mConn, "CREATE TABLE [sequence_$seqName] (id INT NOT NULL IDENTITY PRIMARY KEY, junk varchar(10) NULL)" ); |
| 556 | + $ret = sqlsrv_query( $this->mConn, "CREATE TABLE [sequence_$seqName] (id INT NOT NULL IDENTITY PRIMARY KEY, junk varchar(10) NULL)" ); |
557 | 557 | } |
558 | | - sqlsrv_query( $this->mConn, "INSERT INTO [sequence_$seqName] (junk) VALUES ('')" ); |
| 558 | + $ret = sqlsrv_query( $this->mConn, "INSERT INTO [sequence_$seqName] (junk) VALUES ('')" ); |
559 | 559 | $ret = sqlsrv_query( $this->mConn, "SELECT TOP 1 id FROM [sequence_$seqName] ORDER BY id DESC" ); |
560 | 560 | $row = sqlsrv_fetch_array( $ret, SQLSRV_FETCH_ASSOC );// KEEP ASSOC THERE, weird weird bug dealing with the return value if you don't |
561 | 561 | |
Index: trunk/phase3/includes/WatchlistEditor.php |
— | — | @@ -347,8 +347,7 @@ |
348 | 348 | */ |
349 | 349 | private function showNormalForm( $output, $user ) { |
350 | 350 | global $wgUser; |
351 | | - $count = $this->showItemCount( $output, $user ); |
352 | | - if( $count > 0 ) { |
| 351 | + if( ( $count = $this->showItemCount( $output, $user ) ) > 0 ) { |
353 | 352 | $self = SpecialPage::getTitleFor( 'Watchlist' ); |
354 | 353 | $form = Xml::openElement( 'form', array( 'method' => 'post', |
355 | 354 | 'action' => $self->getLocalUrl( array( 'action' => 'edit' ) ) ) ); |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -2232,9 +2232,7 @@ |
2233 | 2233 | |
2234 | 2234 | $script = ''; |
2235 | 2235 | foreach ( $toolarray as $tool ) { |
2236 | | - if ( !$tool ) { |
2237 | | - continue; |
2238 | | - } |
| 2236 | + if ( !$tool ) continue; |
2239 | 2237 | |
2240 | 2238 | $params = array( |
2241 | 2239 | $image = $wgStylePath . '/common/images/' . $tool['image'], |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -563,6 +563,11 @@ |
564 | 564 | $nameWithTags = Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $name ) ); |
565 | 565 | $this->mPagetitle = $nameWithTags; |
566 | 566 | |
| 567 | + $taction = $this->getPageTitleActionText(); |
| 568 | + if( !empty( $taction ) ) { |
| 569 | + $name .= ' - '.$taction; |
| 570 | + } |
| 571 | + |
567 | 572 | # change "<i>foo&bar</i>" to "foo&bar" |
568 | 573 | $this->setHTMLTitle( wfMsg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) ) ); |
569 | 574 | } |
Index: trunk/phase3/includes/HistoryPage.php |
— | — | @@ -538,9 +538,7 @@ |
539 | 539 | $rev->isDeleted( Revision::DELETED_RESTRICTED ), false ); |
540 | 540 | } |
541 | 541 | } |
542 | | - if ( $del ) { |
543 | | - $s .= " $del "; |
544 | | - } |
| 542 | + if( $del ) $s .= " $del "; |
545 | 543 | |
546 | 544 | $s .= " $link"; |
547 | 545 | $s .= " <span class='history-user'>" . |
Index: trunk/phase3/includes/installer/MysqlUpdater.php |
— | — | @@ -355,7 +355,7 @@ |
356 | 356 | $prev_namespace = $row->cur_namespace; |
357 | 357 | } |
358 | 358 | $sql = "DELETE FROM $cur WHERE cur_id IN ( " . join( ',', $deleteId ) . ')'; |
359 | | - $this->db->query( $sql, __METHOD__ ); |
| 359 | + $rows = $this->db->query( $sql, __METHOD__ ); |
360 | 360 | $this->output( wfTimestamp( TS_DB ) ); |
361 | 361 | $this->output( "......<b>Deleted</b> " . $this->db->affectedRows() . " records.\n" ); |
362 | 362 | } |
Index: trunk/phase3/includes/installer/DatabaseInstaller.php |
— | — | @@ -395,6 +395,7 @@ |
396 | 396 | * Set this to false to show a creation checkbox. |
397 | 397 | */ |
398 | 398 | public function getWebUserBox( $noCreateMsg = false ) { |
| 399 | + $name = $this->getName(); |
399 | 400 | $s = Html::openElement( 'fieldset' ) . |
400 | 401 | Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) . |
401 | 402 | $this->getCheckBox( |
Index: trunk/phase3/includes/installer/MysqlInstaller.php |
— | — | @@ -366,7 +366,7 @@ |
367 | 367 | if ( !$create ) { |
368 | 368 | // Test the web account |
369 | 369 | try { |
370 | | - new Database( |
| 370 | + $webConn = new Database( |
371 | 371 | $this->getVar( 'wgDBserver' ), |
372 | 372 | $this->getVar( 'wgDBuser' ), |
373 | 373 | $this->getVar( 'wgDBpassword' ), |
Index: trunk/phase3/includes/installer/OracleInstaller.php |
— | — | @@ -39,6 +39,7 @@ |
40 | 40 | } |
41 | 41 | |
42 | 42 | public function getWebUserBox( $noCreateMsg = false ) { |
| 43 | + $name = $this->getName(); |
43 | 44 | $this->parent->setVar( '_SameAccount', false ); |
44 | 45 | $this->parent->setVar( '_CreateDBAccount', true ); |
45 | 46 | $this->parent->setVar( 'wgDBname', '' ); |
Index: trunk/phase3/includes/media/SVG.php |
— | — | @@ -150,6 +150,7 @@ |
151 | 151 | } |
152 | 152 | |
153 | 153 | function getMetadata( $file, $filename ) { |
| 154 | + $metadata = array(); |
154 | 155 | try { |
155 | 156 | $metadata = SVGMetadataExtractor::getMetadata( $filename ); |
156 | 157 | } catch( Exception $e ) { |
Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -1055,7 +1055,7 @@ |
1056 | 1056 | # Extract fields from DB into the function scope (rc_xxxx variables) |
1057 | 1057 | // FIXME: Would be good to replace this extract() call with something |
1058 | 1058 | // that explicitly initializes variables. |
1059 | | - // TODO implement |
| 1059 | + $classes = array(); // TODO implement |
1060 | 1060 | extract( $rcObj->mAttribs ); |
1061 | 1061 | $query['curid'] = $rc_cur_id; |
1062 | 1062 | |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -3302,6 +3302,7 @@ |
3303 | 3303 | # Truncate for whole multibyte characters. +5 bytes for ellipsis |
3304 | 3304 | $comment = $wgContLang->truncate( $comment, 250 ); |
3305 | 3305 | |
| 3306 | + $newid = $nt->getArticleID(); |
3306 | 3307 | $oldid = $this->getArticleID(); |
3307 | 3308 | $latest = $this->getLatestRevId(); |
3308 | 3309 | |
Index: trunk/phase3/includes/ConfEditor.php |
— | — | @@ -536,7 +536,7 @@ |
537 | 537 | |
538 | 538 | switch ( $state ) { |
539 | 539 | case 'file': |
540 | | - $this->expect( T_OPEN_TAG ); |
| 540 | + $token = $this->expect( T_OPEN_TAG ); |
541 | 541 | $token = $this->skipSpace(); |
542 | 542 | if ( $token->isEnd() ) { |
543 | 543 | break 2; |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -358,6 +358,7 @@ |
359 | 359 | |
360 | 360 | if( $wgPageShowWatchingUsers ) { |
361 | 361 | $dbr = wfGetDB( DB_SLAVE ); |
| 362 | + $watchlist = $dbr->tableName( 'watchlist' ); |
362 | 363 | $res = $dbr->select( 'watchlist', |
363 | 364 | array( 'COUNT(*) AS n' ), |
364 | 365 | array( 'wl_title' => $dbr->strencode( $this->mTitle->getDBkey() ), 'wl_namespace' => $this->mTitle->getNamespace() ), |
Index: trunk/phase3/includes/specials/SpecialComparePages.php |
— | — | @@ -97,6 +97,7 @@ |
98 | 98 | $this->form(); |
99 | 99 | |
100 | 100 | if( $this->opts->getValue( 'rev1' ) && $this->opts->getValue( 'rev2' ) ) { |
| 101 | + $title = Title::newFromText( $this->opts->getValue( 'page2' ) ); |
101 | 102 | $de = new DifferenceEngine( null, |
102 | 103 | $this->opts->getValue( 'rev1' ), |
103 | 104 | $this->opts->getValue( 'rev2' ), |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -176,6 +176,7 @@ |
177 | 177 | $wgOut->addWikiMsg( 'accmailtext', $u->getName(), $u->getEmail() ); |
178 | 178 | $wgOut->returnToMain( false ); |
179 | 179 | } |
| 180 | + $u = 0; |
180 | 181 | } |
181 | 182 | |
182 | 183 | /** |
— | — | @@ -619,7 +620,7 @@ |
620 | 621 | } |
621 | 622 | |
622 | 623 | wfDebug( __METHOD__ . ": creating account\n" ); |
623 | | - $this->initUser( $user, true ); |
| 624 | + $user = $this->initUser( $user, true ); |
624 | 625 | return self::SUCCESS; |
625 | 626 | } |
626 | 627 | |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -342,9 +342,9 @@ |
343 | 343 | global $wgOut; |
344 | 344 | // Figure out the active search profile header |
345 | 345 | $nsAllSet = array_keys( SearchEngine::searchableNamespaces() ); |
346 | | - if( $this->searchAdvanced ) { |
| 346 | + if( $this->searchAdvanced ) |
347 | 347 | $this->active = 'advanced'; |
348 | | - } else { |
| 348 | + else { |
349 | 349 | $profiles = $this->getSearchProfiles(); |
350 | 350 | |
351 | 351 | foreach( $profiles as $key => $data ) { |
— | — | @@ -416,6 +416,7 @@ |
417 | 417 | if( !is_null($infoLine) ) { |
418 | 418 | $out .= "\n<!-- {$infoLine} -->\n"; |
419 | 419 | } |
| 420 | + $off = $this->offset + 1; |
420 | 421 | $out .= "<ul class='mw-search-results'>\n"; |
421 | 422 | while( $result = $matches->next() ) { |
422 | 423 | $out .= $this->showHit( $result, $terms ); |
— | — | @@ -622,6 +623,7 @@ |
623 | 624 | |
624 | 625 | $out = "<div id='mw-search-interwiki'><div id='mw-search-interwiki-caption'>". |
625 | 626 | wfMsg('search-interwiki-caption')."</div>\n"; |
| 627 | + $off = $this->offset + 1; |
626 | 628 | $out .= "<ul class='mw-search-iwresults'>\n"; |
627 | 629 | |
628 | 630 | // work out custom project captions |