Index: trunk/phase3/includes/SpecialListusers.php |
— | — | @@ -198,10 +198,6 @@ |
199 | 199 | function wfSpecialListusers( $par = null ) { |
200 | 200 | global $wgRequest, $wgOut; |
201 | 201 | |
202 | | - list( $limit, $offset ) = wfCheckLimits(); |
203 | | - |
204 | | - $groupTarget = isset($par) ? $par : $wgRequest->getVal( 'group' ); |
205 | | - |
206 | 202 | $up = new UsersPager($par); |
207 | 203 | |
208 | 204 | # getBody() first to check, if empty |
Index: trunk/phase3/includes/Database.php |
— | — | @@ -214,7 +214,7 @@ |
215 | 215 | |
216 | 216 | $cache = new HTMLFileCache( $t ); |
217 | 217 | if( $cache->isFileCached() ) { |
218 | | - // FIXME: $msg is not defined on the next line. |
| 218 | + // @todo, FIXME: $msg is not defined on the next line. |
219 | 219 | $msg = '<p style="color: red"><b>'.$msg."<br />\n" . |
220 | 220 | $cachederror . "</b></p>\n"; |
221 | 221 | |
Index: trunk/phase3/includes/SpecialUndelete.php |
— | — | @@ -328,7 +328,6 @@ |
329 | 329 | $restoreAll = empty( $timestamps ); |
330 | 330 | |
331 | 331 | $dbw = wfGetDB( DB_MASTER ); |
332 | | - $page = $dbw->tableName( 'archive' ); |
333 | 332 | |
334 | 333 | # Does this page already exist? We'll have to update it... |
335 | 334 | $article = new Article( $this->title ); |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1028,6 +1028,7 @@ |
1029 | 1029 | $medians = '(?:' . preg_quote( Namespace::getCanonicalName( NS_MEDIA ), '/' ) . '|'; |
1030 | 1030 | $medians .= preg_quote( $wgContLang->getNsText( NS_MEDIA ), '/' ) . '):'; |
1031 | 1031 | |
| 1032 | + $match = array(); |
1032 | 1033 | while(preg_match('/\[\[:?(.*?)(\|(.*?))*\]\](.*)$/',$comment,$match)) { |
1033 | 1034 | # Handle link renaming [[foo|text]] will show link as "text" |
1034 | 1035 | if( "" != $match[3] ) { |
Index: trunk/phase3/includes/media/Generic.php |
— | — | @@ -207,6 +207,7 @@ |
208 | 208 | global $wgLang; |
209 | 209 | $nbytes = '(' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), |
210 | 210 | $wgLang->formatNum( $file->getSize() ) ) . ')'; |
| 211 | + return "($nbytes)"; |
211 | 212 | } |
212 | 213 | |
213 | 214 | function getLongDesc( $file ) { |
Index: trunk/phase3/includes/SpecialWantedpages.php |
— | — | @@ -71,7 +71,6 @@ |
72 | 72 | * @return string |
73 | 73 | */ |
74 | 74 | public function formatResult( $skin, $result ) { |
75 | | - global $wgLang; |
76 | 75 | $title = Title::makeTitleSafe( $result->namespace, $result->title ); |
77 | 76 | if( $title instanceof Title ) { |
78 | 77 | if( $this->isCached() ) { |
Index: trunk/phase3/includes/SpecialUserlogin.php |
— | — | @@ -8,7 +8,6 @@ |
9 | 9 | * constructor |
10 | 10 | */ |
11 | 11 | function wfSpecialUserlogin() { |
12 | | - global $wgCommandLineMode; |
13 | 12 | global $wgRequest; |
14 | 13 | if( session_id() == '' ) { |
15 | 14 | wfSetupSession(); |
Index: trunk/phase3/includes/MagicWord.php |
— | — | @@ -518,7 +518,7 @@ |
519 | 519 | // continue; |
520 | 520 | throw new MWException( __METHOD__ . ': bad parameter name' ); |
521 | 521 | } |
522 | | - list( $synIndex, $magicName ) = $parts; |
| 522 | + list( /* $synIndex */, $magicName ) = $parts; |
523 | 523 | $paramValue = next( $m ); |
524 | 524 | return array( $magicName, $paramValue ); |
525 | 525 | } |
— | — | @@ -536,7 +536,7 @@ |
537 | 537 | public function matchVariableStartToEnd( $text ) { |
538 | 538 | global $wgContLang; |
539 | 539 | $regexes = $this->getVariableStartToEndRegex(); |
540 | | - foreach ( $regexes as $case => $regex ) { |
| 540 | + foreach ( $regexes as $regex ) { |
541 | 541 | if ( $regex !== '' ) { |
542 | 542 | $m = false; |
543 | 543 | if ( preg_match( $regex, $text, $m ) ) { |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -298,7 +298,6 @@ |
299 | 299 | */ |
300 | 300 | function edit() { |
301 | 301 | global $wgOut, $wgUser, $wgRequest, $wgTitle; |
302 | | - global $wgEmailConfirmToEdit; |
303 | 302 | |
304 | 303 | if ( ! wfRunHooks( 'AlternateEdit', array( &$this ) ) ) |
305 | 304 | return; |
— | — | @@ -333,10 +332,11 @@ |
334 | 333 | |
335 | 334 | if ($error[0] == 'readonlytext') |
336 | 335 | { |
337 | | - if ($this->edit) |
| 336 | + if ($this->edit) { |
338 | 337 | $this->formtype = 'preview'; |
339 | | - else if ($this->save || $this->preview || $this->diff) |
| 338 | + } elseif ($this->save || $this->preview || $this->diff) { |
340 | 339 | $remove[] = $error; |
| 340 | + } |
341 | 341 | } |
342 | 342 | } |
343 | 343 | # array_diff returns elements in $permErrors that are not in $remove. |
— | — | @@ -1018,9 +1018,10 @@ |
1019 | 1019 | if ( count($cascadeSources) > 0 ) { |
1020 | 1020 | # Explain, and list the titles responsible |
1021 | 1021 | $notice = wfMsgExt( 'cascadeprotectedwarning', array('parsemag'), count($cascadeSources) ) . "\n"; |
1022 | | - foreach( $cascadeSources as $id => $page ) |
| 1022 | + foreach( $cascadeSources as $page ) { |
1023 | 1023 | $notice .= '* [[:' . $page->getPrefixedText() . "]]\n"; |
1024 | 1024 | } |
| 1025 | + } |
1025 | 1026 | $wgOut->addWikiText( $notice ); |
1026 | 1027 | } |
1027 | 1028 | |
Index: trunk/phase3/includes/FileDeleteForm.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | * pending authentication, confirmation, etc. |
31 | 31 | */ |
32 | 32 | public function execute() { |
33 | | - global $wgOut, $wgRequest, $wgUser, $wgLang, $wgServer; |
| 33 | + global $wgOut, $wgRequest, $wgUser; |
34 | 34 | $this->setHeaders(); |
35 | 35 | |
36 | 36 | if( wfReadOnly() ) { |
Index: trunk/phase3/includes/SpecialWatchlist.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | * @param $par Parameter passed to the page |
17 | 17 | */ |
18 | 18 | function wfSpecialWatchlist( $par ) { |
19 | | - global $wgUser, $wgOut, $wgLang, $wgRequest, $wgContLang; |
| 19 | + global $wgUser, $wgOut, $wgLang, $wgRequest; |
20 | 20 | global $wgRCShowWatchingUsers, $wgEnotifWatchlist, $wgShowUpdatedMarker; |
21 | 21 | global $wgEnotifWatchlist; |
22 | 22 | $fname = 'wfSpecialWatchlist'; |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -802,6 +802,7 @@ |
803 | 803 | // Give hooks a chance to customise the output |
804 | 804 | if( wfRunHooks( 'ShowRawCssJs', array( $this->mContent, $this->mTitle, $wgOut ) ) ) { |
805 | 805 | // Wrap the whole lot in a <pre> and don't parse |
| 806 | + $m = array(); |
806 | 807 | preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m ); |
807 | 808 | $wgOut->addHtml( "<pre class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" ); |
808 | 809 | $wgOut->addHtml( htmlspecialchars( $this->mContent ) ); |
— | — | @@ -2344,7 +2345,7 @@ |
2345 | 2346 | $wgOut->returnToMain( false, $this->mTitle ); |
2346 | 2347 | break; |
2347 | 2348 | default: |
2348 | | - throw new MWException( __METHOD__ . ": Unknown return value `{$retval}`" ); |
| 2349 | + throw new MWException( __METHOD__ . ": Unknown return value `{$result}`" ); |
2349 | 2350 | } |
2350 | 2351 | |
2351 | 2352 | } |
Index: trunk/phase3/includes/SpecialUpload.php |
— | — | @@ -443,6 +443,7 @@ |
444 | 444 | } |
445 | 445 | // Success, redirect to description page |
446 | 446 | $wgOut->redirect( $this->mLocalFile->getTitle()->getFullURL() ); |
| 447 | + $img = null; // @todo: added to avoid passing a ref to null - should this be defined somewhere? |
447 | 448 | wfRunHooks( 'UploadComplete', array( &$img ) ); |
448 | 449 | } |
449 | 450 | } |
— | — | @@ -736,7 +737,7 @@ |
737 | 738 | function mainUploadForm( $msg='' ) { |
738 | 739 | global $wgOut, $wgUser, $wgContLang; |
739 | 740 | global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview; |
740 | | - global $wgRequest, $wgAllowCopyUploads, $wgEnableAPI; |
| 741 | + global $wgRequest, $wgAllowCopyUploads; |
741 | 742 | global $wgStylePath, $wgStyleVersion; |
742 | 743 | |
743 | 744 | $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck; |
Index: trunk/phase3/includes/UserMailer.php |
— | — | @@ -250,7 +250,6 @@ |
251 | 251 | |
252 | 252 | function notifyOnPageChange($editor, &$title, $timestamp, $summary, $minorEdit, $oldid = false) { |
253 | 253 | global $wgEnotifUseJobQ; |
254 | | - global $wgEnotifWatchlist, $wgShowUpdatedMarker; |
255 | 254 | |
256 | 255 | if( $title->getNamespace() < 0 ) |
257 | 256 | return; |
Index: trunk/phase3/includes/SpecialProtectedpages.php |
— | — | @@ -241,7 +241,6 @@ |
242 | 242 | } |
243 | 243 | |
244 | 244 | function formatRow( $row ) { |
245 | | - $block = new Block; |
246 | 245 | return $this->mForm->formatRow( $row ); |
247 | 246 | } |
248 | 247 | |
— | — | @@ -278,8 +277,6 @@ |
279 | 278 | */ |
280 | 279 | function wfSpecialProtectedpages() { |
281 | 280 | |
282 | | - list( $limit, $offset ) = wfCheckLimits(); |
283 | | - |
284 | 281 | $ppForm = new ProtectedPagesForm(); |
285 | 282 | |
286 | 283 | $ppForm->showList(); |
Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -251,7 +251,7 @@ |
252 | 252 | 'rc_patrolled' => 1 |
253 | 253 | ), |
254 | 254 | array( |
255 | | - 'rc_id' => $change |
| 255 | + 'rc_id' => $rcid |
256 | 256 | ), |
257 | 257 | __METHOD__ |
258 | 258 | ); |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1027,7 +1027,6 @@ |
1028 | 1028 | $this->addWikiText( wfMsgExt( 'cascadeprotected', 'parsemag', $count ) . "\n{$titles}" ); |
1029 | 1029 | } elseif( !$wgTitle->isProtected( 'edit' ) && $wgTitle->isNamespaceProtected() ) { |
1030 | 1030 | // Namespace protection |
1031 | | - global $wgNamespaceProtection; |
1032 | 1031 | $ns = $wgTitle->getNamespace() == NS_MAIN |
1033 | 1032 | ? wfMsg( 'nstab-main' ) |
1034 | 1033 | : $wgTitle->getNsText(); |
Index: trunk/phase3/includes/SpecialUserrights.php |
— | — | @@ -319,7 +319,7 @@ |
320 | 320 | * @return Array array( 'add' => array( addablegroups ), 'remove' => array( removablegroups ) ) |
321 | 321 | */ |
322 | 322 | private function changeableGroups() { |
323 | | - global $wgUser, $wgGroupPermissions; |
| 323 | + global $wgUser; |
324 | 324 | |
325 | 325 | $groups = array( 'add' => array(), 'remove' => array() ); |
326 | 326 | $addergroups = $wgUser->getEffectiveGroups(); |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -279,6 +279,7 @@ |
280 | 280 | $redir = MagicWord::get( 'redirect' ); |
281 | 281 | if( $redir->matchStart( $text ) ) { |
282 | 282 | // Extract the first link and see if it's usable |
| 283 | + $m = array(); |
283 | 284 | if( preg_match( '!\[{2}(.*?)(?:\||\]{2})!', $text, $m ) ) { |
284 | 285 | // Strip preceding colon used to "escape" categories, etc. |
285 | 286 | // and URL-decode links |
— | — | @@ -1034,7 +1035,7 @@ |
1035 | 1036 | $errors[] = array( 'readonlytext' ); |
1036 | 1037 | } |
1037 | 1038 | |
1038 | | - global $wgEmailConfirmToEdit; |
| 1039 | + global $wgEmailConfirmToEdit, $wgUser; |
1039 | 1040 | |
1040 | 1041 | if ( $wgEmailConfirmToEdit && !$wgUser->isEmailConfirmed() ) |
1041 | 1042 | { |
— | — | @@ -1147,7 +1148,7 @@ |
1148 | 1149 | $right = ( $right == 'sysop' ) ? 'protect' : $right; |
1149 | 1150 | if( '' != $right && !$user->isAllowed( $right ) ) { |
1150 | 1151 | $pages = ''; |
1151 | | - foreach( $cascadingSources as $id => $page ) |
| 1152 | + foreach( $cascadingSources as $page ) |
1152 | 1153 | $pages .= '* [[:' . $page->getPrefixedText() . "]]\n"; |
1153 | 1154 | $errors[] = array( 'cascadeprotected', count( $cascadingSources ), $pages ); |
1154 | 1155 | } |
— | — | @@ -1294,7 +1295,7 @@ |
1295 | 1296 | */ |
1296 | 1297 | if( $this->getNamespace() == NS_SPECIAL ) { |
1297 | 1298 | $name = $this->getText(); |
1298 | | - list( $name, $subpage ) = SpecialPage::resolveAliasWithSubpage( $name ); |
| 1299 | + list( $name, /* $subpage */) = SpecialPage::resolveAliasWithSubpage( $name ); |
1299 | 1300 | $pure = SpecialPage::getTitleFor( $name )->getPrefixedText(); |
1300 | 1301 | if( in_array( $pure, $wgWhitelistRead, true ) ) |
1301 | 1302 | return true; |
— | — | @@ -1396,7 +1397,7 @@ |
1397 | 1398 | * @return bool If the page is subject to cascading restrictions. |
1398 | 1399 | */ |
1399 | 1400 | public function isCascadeProtected() { |
1400 | | - list( $sources, $restrictions ) = $this->getCascadeProtectionSources( false ); |
| 1401 | + list( $sources, /* $restrictions */ ) = $this->getCascadeProtectionSources( false ); |
1401 | 1402 | return ( $sources > 0 ); |
1402 | 1403 | } |
1403 | 1404 | |
Index: trunk/phase3/includes/SpecialMovepage.php |
— | — | @@ -266,7 +266,7 @@ |
267 | 267 | } |
268 | 268 | |
269 | 269 | function showSuccess() { |
270 | | - global $wgOut, $wgRequest, $wgUser, $wgRawHtml; |
| 270 | + global $wgOut, $wgRequest, $wgUser; |
271 | 271 | |
272 | 272 | $old = Title::newFromText( $wgRequest->getVal( 'oldtitle' ) ); |
273 | 273 | $new = Title::newFromText( $wgRequest->getVal( 'newtitle' ) ); |
Index: trunk/phase3/includes/filerepo/OldLocalFile.php |
— | — | @@ -207,7 +207,6 @@ |
208 | 208 | |
209 | 209 | $dbw = $this->repo->getMasterDB(); |
210 | 210 | list( $major, $minor ) = self::splitMime( $this->mime ); |
211 | | - $mime = $this->mime; |
212 | 211 | |
213 | 212 | wfDebug(__METHOD__.': upgrading '.$this->archive_name." to the current schema\n"); |
214 | 213 | $dbw->update( 'oldimage', |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -210,7 +210,6 @@ |
211 | 211 | } |
212 | 212 | $decoded = array(); |
213 | 213 | foreach ( $array as $name => $value ) { |
214 | | - $deprefixedName = substr( $name, $prefixLength ); |
215 | 214 | $decoded[substr( $name, $prefixLength )] = $value; |
216 | 215 | } |
217 | 216 | $decoded['timestamp'] = wfTimestamp( TS_MW, $decoded['timestamp'] ); |
— | — | @@ -539,7 +538,6 @@ |
540 | 539 | $dir = $this->getThumbPath(); |
541 | 540 | $urls = array(); |
542 | 541 | foreach ( $files as $file ) { |
543 | | - $m = array(); |
544 | 542 | # Check that the base file name is part of the thumb name |
545 | 543 | # This is a basic sanity check to avoid erasing unrelated directories |
546 | 544 | if ( strpos( $file, $this->getName() ) !== false ) { |
— | — | @@ -1243,7 +1241,6 @@ |
1244 | 1242 | $dbw = $this->file->repo->getMasterDB(); |
1245 | 1243 | list( $oldRels, $deleteCurrent ) = $this->getOldRels(); |
1246 | 1244 | if ( $deleteCurrent ) { |
1247 | | - $where = array( 'img_name' => $this->file->getName() ); |
1248 | 1245 | $dbw->delete( 'image', array( 'img_name' => $this->file->getName() ), __METHOD__ ); |
1249 | 1246 | } |
1250 | 1247 | if ( count( $oldRels ) ) { |
— | — | @@ -1425,7 +1422,6 @@ |
1426 | 1423 | if ( $first && !$exists ) { |
1427 | 1424 | // This revision will be published as the new current version |
1428 | 1425 | $destRel = $this->file->getRel(); |
1429 | | - $info = $this->file->repo->getFileProps( $deletedUrl ); |
1430 | 1426 | $insertCurrent = array( |
1431 | 1427 | 'img_name' => $row->fa_name, |
1432 | 1428 | 'img_size' => $row->fa_size, |
Index: trunk/phase3/includes/filerepo/RepoGroup.php |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | |
137 | 137 | function getFileProps( $fileName ) { |
138 | 138 | if ( FileRepo::isVirtualUrl( $fileName ) ) { |
139 | | - list( $repoName, $zone, $rel ) = $this->splitVirtualUrl( $fileName ); |
| 139 | + list( $repoName, /* $zone */, /* $rel */ ) = $this->splitVirtualUrl( $fileName ); |
140 | 140 | if ( $repoName === '' ) { |
141 | 141 | $repoName = 'local'; |
142 | 142 | } |
Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | $r = wfMsg( 'metadata-help' ) . "\n\n"; |
131 | 131 | $r .= "{| id=mw_metadata class=mw_metadata\n"; |
132 | 132 | foreach ( $metadata as $type => $stuff ) { |
133 | | - foreach ( $stuff as $k => $v ) { |
| 133 | + foreach ( $stuff as $v ) { |
134 | 134 | $class = Sanitizer::escapeId( $v['id'] ); |
135 | 135 | if( $type == 'collapsed' ) { |
136 | 136 | $class .= ' collapsable'; |
— | — | @@ -308,7 +308,6 @@ |
309 | 309 | |
310 | 310 | if ($showLink) { |
311 | 311 | $filename = wfEscapeWikiText( $this->img->getName() ); |
312 | | - $info = wfMsg( 'file-info', $sk->formatSize( $this->img->getSize() ), $mime ); |
313 | 312 | |
314 | 313 | global $wgContLang; |
315 | 314 | $dirmark = $wgContLang->getDirMark(); |
— | — | @@ -566,7 +565,7 @@ |
567 | 566 | } |
568 | 567 | |
569 | 568 | public function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description, $dims ) { |
570 | | - global $wgUser, $wgLang, $wgTitle, $wgContLang; |
| 569 | + global $wgUser, $wgLang, $wgContLang; |
571 | 570 | $local = $this->img->isLocal(); |
572 | 571 | $row = ''; |
573 | 572 | |
Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -106,12 +106,13 @@ |
107 | 107 | $this->addTables('interwiki'); |
108 | 108 | $this->addFields(array('iw_prefix', 'iw_local', 'iw_url')); |
109 | 109 | |
110 | | - if($filter === 'local') |
| 110 | + if($filter === 'local') { |
111 | 111 | $this->addWhere('iw_local = 1'); |
112 | | - else if($filter === '!local') |
| 112 | + } elseif($filter === '!local') { |
113 | 113 | $this->addWhere('iw_local = 0'); |
114 | | - else if($filter !== false) |
| 114 | + } elseif($filter !== false) { |
115 | 115 | ApiBase :: dieDebug(__METHOD__, "Unknown filter=$filter"); |
| 116 | + } |
116 | 117 | |
117 | 118 | $this->addOption('ORDER BY', 'iw_prefix'); |
118 | 119 | |