Index: trunk/phase3/includes/SpecialBooksources.php |
— | — | @@ -48,7 +48,6 @@ |
49 | 49 | |
50 | 50 | function showList() { |
51 | 51 | global $wgOut, $wgContLang; |
52 | | - $fname = "BookSourceList::showList()"; |
53 | 52 | |
54 | 53 | # First, see if we have a custom list setup in |
55 | 54 | # [[Wikipedia:Book sources]] or equivalent. |
— | — | @@ -93,7 +92,6 @@ |
94 | 93 | |
95 | 94 | function askForm() { |
96 | 95 | global $wgOut, $wgTitle; |
97 | | - $fname = "BookSourceList::askForm()"; |
98 | 96 | |
99 | 97 | $action = $wgTitle->escapeLocalUrl(); |
100 | 98 | $isbn = htmlspecialchars( wfMsg( "isbn" ) ); |
Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -184,7 +184,7 @@ |
185 | 185 | $s .= ' '.$articlelink; |
186 | 186 | } |
187 | 187 | |
188 | | - function insertTimestamp(&$s, &$rc) { |
| 188 | + function insertTimestamp(&$s, $rc) { |
189 | 189 | global $wgLang; |
190 | 190 | # Timestamp |
191 | 191 | $s .= '; ' . $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . '; |
— | — | @@ -233,7 +233,6 @@ |
234 | 234 | |
235 | 235 | # Extract DB fields into local scope |
236 | 236 | extract( $rc->mAttribs ); |
237 | | - $curIdEq = 'curid=' . $rc_cur_id; |
238 | 237 | |
239 | 238 | # Should patrol-related stuff be shown? |
240 | 239 | $unpatrolled = $this->usePatrol() && $rc_patrolled == 0; |
— | — | @@ -413,7 +412,6 @@ |
414 | 413 | $userlinks = array(); |
415 | 414 | foreach( $block as $rcObj ) { |
416 | 415 | $oldid = $rcObj->mAttribs['rc_last_oldid']; |
417 | | - $newid = $rcObj->mAttribs['rc_this_oldid']; |
418 | 416 | if( $rcObj->mAttribs['rc_new'] ) { |
419 | 417 | $isnew = true; |
420 | 418 | } |
— | — | @@ -643,7 +641,7 @@ |
644 | 642 | return ''; |
645 | 643 | } |
646 | 644 | $blockOut = ''; |
647 | | - foreach( $this->rc_cache as $secureName => $block ) { |
| 645 | + foreach( $this->rc_cache as $block ) { |
648 | 646 | if( count( $block ) < 2 ) { |
649 | 647 | $blockOut .= $this->recentChangesBlockLine( array_shift( $block ) ); |
650 | 648 | } else { |
Index: trunk/phase3/includes/IP.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * @return boolean True if it is valid. |
29 | 29 | */ |
30 | 30 | public static function isValid( $ip ) { |
31 | | - return preg_match( '/^' . RE_IP_ADD . '$/', $ip, $matches) ; |
| 31 | + return preg_match( '/^' . RE_IP_ADD . '$/', $ip) ; |
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
— | — | @@ -84,6 +84,7 @@ |
85 | 85 | * @return array |
86 | 86 | */ |
87 | 87 | public static function toArray( $ipblock ) { |
| 88 | + $matches = array(); |
88 | 89 | if(! preg_match( '/^' . RE_IP_ADD . '(?:\/(?:'.RE_IP_PREFIX.'))?' . '$/', $ipblock, $matches ) ) { |
89 | 90 | return false; |
90 | 91 | } else { |
Index: trunk/phase3/includes/Metadata.php |
— | — | @@ -22,7 +22,8 @@ |
23 | 23 | */ |
24 | 24 | |
25 | 25 | /** |
26 | | - * |
| 26 | + * TODO: Perhaps make this file into a Metadata class, with static methods (declared |
| 27 | + * as private where indicated), to move these functions out of the global namespace? |
27 | 28 | */ |
28 | 29 | define('RDF_TYPE_PREFS', "application/rdf+xml,text/xml;q=0.7,application/xml;q=0.5,text/rdf;q=0.1"); |
29 | 30 | |
— | — | @@ -142,7 +143,7 @@ |
143 | 144 | dcPerson('contributor', $user_parts[0], $user_parts[1], $user_parts[2]); |
144 | 145 | } |
145 | 146 | |
146 | | - dcRights($article); |
| 147 | + dcRights(); |
147 | 148 | } |
148 | 149 | |
149 | 150 | /** |
— | — | @@ -291,7 +292,7 @@ |
292 | 293 | * different pages. |
293 | 294 | * @private |
294 | 295 | */ |
295 | | -function dcRights($article) { |
| 296 | +function dcRights() { |
296 | 297 | |
297 | 298 | global $wgRightsPage, $wgRightsUrl, $wgRightsText; |
298 | 299 | |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -2330,7 +2330,11 @@ |
2331 | 2331 | */ |
2332 | 2332 | function isFileCacheable() { |
2333 | 2333 | global $wgUser, $wgUseFileCache, $wgShowIPinHeader, $wgRequest; |
2334 | | - extract( $wgRequest->getValues( 'action', 'oldid', 'diff', 'redirect', 'printable' ) ); |
| 2334 | + $action = $wgRequest->getVal( 'action' ); |
| 2335 | + $oldid = $wgRequest->getVal( 'oldid' ); |
| 2336 | + $diff = $wgRequest->getVal( 'diff' ); |
| 2337 | + $redirect = $wgRequest->getVal( 'redirect' ); |
| 2338 | + $printable = $wgRequest->getVal( 'printable' ); |
2335 | 2339 | |
2336 | 2340 | return $wgUseFileCache |
2337 | 2341 | and (!$wgShowIPinHeader) |
— | — | @@ -2700,8 +2704,6 @@ |
2701 | 2705 | # This code is UGLY UGLY UGLY. |
2702 | 2706 | # Somebody PLEASE come up with a more elegant way to do it. |
2703 | 2707 | |
2704 | | - $summary = ''; |
2705 | | - |
2706 | 2708 | #Redirect autosummaries |
2707 | 2709 | $summary = self::getRedirectAutosummary( $newtext ); |
2708 | 2710 | |
Index: trunk/phase3/includes/Pager.php |
— | — | @@ -323,7 +323,7 @@ |
324 | 324 | $next = array( 'offset' => $this->mLastShown, 'limit' => $urlLimit ); |
325 | 325 | $last = array( 'dir' => 'prev', 'limit' => $urlLimit ); |
326 | 326 | } |
327 | | - return compact( 'prev', 'next', 'first', 'last' ); |
| 327 | + return array( 'prev' => $prev, 'next' => $next, 'first' => $first, 'last' => $last ); |
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
Index: trunk/phase3/includes/SearchTsearch2.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | $this->searchTerms = array(); |
49 | 49 | |
50 | 50 | # FIXME: This doesn't handle parenthetical expressions. |
| 51 | + $m = array(); |
51 | 52 | if( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/', |
52 | 53 | $filteredText, $m, PREG_SET_ORDER ) ) { |
53 | 54 | foreach( $m as $terms ) { |
— | — | @@ -64,7 +65,7 @@ |
65 | 66 | $this->searchTerms[] = $regexp; |
66 | 67 | } |
67 | 68 | wfDebug( "Would search with '$searchon'\n" ); |
68 | | - wfDebug( "Match with /\b" . implode( '\b|\b', $this->searchTerms ) . "\b/\n" ); |
| 69 | + wfDebug( 'Match with /\b' . implode( '\b|\b', $this->searchTerms ) . "\b/\n" ); |
69 | 70 | } else { |
70 | 71 | wfDebug( "Can't understand search query '{$this->filteredText}'\n" ); |
71 | 72 | } |
Index: trunk/phase3/includes/SpecialSpecialpages.php |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | |
39 | 39 | /** Put them into a sortable array */ |
40 | 40 | $sortedPages = array(); |
41 | | - foreach ( $pages as $name => $page ) { |
| 41 | + foreach ( $pages as $page ) { |
42 | 42 | if ( $page->isListed() ) { |
43 | 43 | $sortedPages[$page->getDescription()] = $page->getTitle(); |
44 | 44 | } |
Index: trunk/phase3/includes/SpecialSearch.php |
— | — | @@ -77,7 +77,6 @@ |
78 | 78 | function goResult( $term ) { |
79 | 79 | global $wgOut; |
80 | 80 | global $wgGoToEdit; |
81 | | - global $wgContLang; |
82 | 81 | |
83 | 82 | $this->setupPage( $term ); |
84 | 83 | |
— | — | @@ -98,17 +97,13 @@ |
99 | 98 | |
100 | 99 | # No match, generate an edit URL |
101 | 100 | $t = Title::newFromText( $term ); |
102 | | - if( is_null( $t ) ) { |
103 | | - $editurl = ''; # hrm... |
104 | | - } else { |
| 101 | + if( ! is_null( $t ) ) { |
105 | 102 | wfRunHooks( 'SpecialSearchNogomatch', array( &$t ) ); |
106 | 103 | # If the feature is enabled, go straight to the edit page |
107 | 104 | if ( $wgGoToEdit ) { |
108 | 105 | $wgOut->redirect( $t->getFullURL( 'action=edit' ) ); |
109 | 106 | return; |
110 | | - } else { |
111 | | - $editurl = $t->escapeLocalURL( 'action=edit' ); |
112 | | - } |
| 107 | + } |
113 | 108 | } |
114 | 109 | $wgOut->addWikiText( wfMsg( 'noexactmatch', wfEscapeWikiText( $term ) ) ); |
115 | 110 | |
— | — | @@ -125,8 +120,7 @@ |
126 | 121 | |
127 | 122 | $this->setupPage( $term ); |
128 | 123 | |
129 | | - global $wgUser, $wgOut; |
130 | | - $sk = $wgUser->getSkin(); |
| 124 | + global $wgOut; |
131 | 125 | $wgOut->addWikiText( wfMsg( 'searchresulttext' ) ); |
132 | 126 | |
133 | 127 | #if ( !$this->parseQuery() ) { |
— | — | @@ -347,6 +341,7 @@ |
348 | 342 | break; |
349 | 343 | } |
350 | 344 | ++$lineno; |
| 345 | + $m = array(); |
351 | 346 | if ( ! preg_match( $pat1, $line, $m ) ) { |
352 | 347 | continue; |
353 | 348 | } |
Index: trunk/phase3/includes/memcached-client.php |
— | — | @@ -451,7 +451,8 @@ |
452 | 452 | return false; |
453 | 453 | |
454 | 454 | $this->stats['get_multi']++; |
455 | | - |
| 455 | + $sock_keys = array(); |
| 456 | + |
456 | 457 | foreach ($keys as $key) |
457 | 458 | { |
458 | 459 | $sock = $this->get_sock($key); |
— | — | @@ -697,6 +698,7 @@ |
698 | 699 | list ($ip, $port) = explode(":", $host); |
699 | 700 | $sock = false; |
700 | 701 | $timeout = $this->_connect_timeout; |
| 702 | + $errno = $errstr = null; |
701 | 703 | for ($i = 0; !$sock && $i < $this->_connect_attempts; $i++) { |
702 | 704 | if ($i > 0) { |
703 | 705 | # Sleep until the timeout, in case it failed fast |
— | — | @@ -740,7 +742,7 @@ |
741 | 743 | function _dead_sock ($sock) |
742 | 744 | { |
743 | 745 | $host = array_search($sock, $this->_cache_sock); |
744 | | - @list ($ip, $port) = explode(":", $host); |
| 746 | + @list ($ip, /* $port */) = explode(":", $host); |
745 | 747 | $this->_host_dead[$ip] = time() + 30 + intval(rand(0, 10)); |
746 | 748 | $this->_host_dead[$host] = $this->_host_dead[$ip]; |
747 | 749 | unset($this->_cache_sock[$host]); |
— | — | @@ -849,6 +851,7 @@ |
850 | 852 | |
851 | 853 | stream_set_timeout($sock, 1, 0); |
852 | 854 | $line = fgets($sock); |
| 855 | + $match = array(); |
853 | 856 | if (!preg_match('/^(\d+)/', $line, $match)) |
854 | 857 | return null; |
855 | 858 | return $match[1]; |
— | — | @@ -1001,8 +1004,9 @@ |
1002 | 1005 | if (isset($this->_cache_sock[$host])) |
1003 | 1006 | return $this->_cache_sock[$host]; |
1004 | 1007 | |
| 1008 | + $sock = null; |
1005 | 1009 | $now = time(); |
1006 | | - list ($ip, $port) = explode (":", $host); |
| 1010 | + list ($ip, /* $port */) = explode (":", $host); |
1007 | 1011 | if (isset($this->_host_dead[$host]) && $this->_host_dead[$host] > $now || |
1008 | 1012 | isset($this->_host_dead[$ip]) && $this->_host_dead[$ip] > $now) |
1009 | 1013 | return null; |
Index: trunk/phase3/includes/SquidUpdate.php |
— | — | @@ -29,8 +29,6 @@ |
30 | 30 | wfProfileIn( $fname ); |
31 | 31 | |
32 | 32 | # Get a list of URLs linking to this page |
33 | | - $id = $title->getArticleID(); |
34 | | - |
35 | 33 | $dbr =& wfGetDB( DB_SLAVE ); |
36 | 34 | $res = $dbr->select( array( 'links', 'page' ), |
37 | 35 | array( 'page_namespace', 'page_title' ), |
Index: trunk/phase3/includes/PageHistory.php |
— | — | @@ -106,7 +106,6 @@ |
107 | 107 | * Do the list |
108 | 108 | */ |
109 | 109 | $pager = new PageHistoryPager( $this ); |
110 | | - $navbar = $pager->getNavigationBar(); |
111 | 110 | $this->linesonpage = $pager->getNumRows(); |
112 | 111 | $wgOut->addHTML( |
113 | 112 | $pager->getNavigationBar() . |
Index: trunk/phase3/includes/Database.php |
— | — | @@ -90,8 +90,8 @@ |
91 | 91 | } |
92 | 92 | |
93 | 93 | function getHTML() { |
94 | | - global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding, $wgOutputEncoding; |
95 | | - global $wgSitename, $wgServer, $wgMessageCache, $wgLogo; |
| 94 | + global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding; |
| 95 | + global $wgSitename, $wgServer, $wgMessageCache; |
96 | 96 | |
97 | 97 | # I give up, Brion is right. Getting the message cache to work when there is no DB is tricky. |
98 | 98 | # Hard coding strings instead. |
— | — | @@ -621,7 +621,7 @@ |
622 | 622 | |
623 | 623 | # Add a comment for easy SHOW PROCESSLIST interpretation |
624 | 624 | if ( $fname ) { |
625 | | - $commentedSql = preg_replace("/\s/", " /* $fname */ ", $sql, 1); |
| 625 | + $commentedSql = preg_replace('/\s/', " /* $fname */ ", $sql, 1); |
626 | 626 | } else { |
627 | 627 | $commentedSql = $sql; |
628 | 628 | } |
— | — | @@ -687,7 +687,7 @@ |
688 | 688 | * @param bool $tempIgnore |
689 | 689 | */ |
690 | 690 | function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) { |
691 | | - global $wgCommandLineMode, $wgFullyInitialised, $wgColorErrors; |
| 691 | + global $wgCommandLineMode; |
692 | 692 | # Ignore errors during error handling to avoid infinite recursion |
693 | 693 | $ignore = $this->ignoreErrors( true ); |
694 | 694 | ++$this->mErrorCount; |
— | — | @@ -786,7 +786,7 @@ |
787 | 787 | case '\\!': return '!'; |
788 | 788 | case '\\&': return '&'; |
789 | 789 | } |
790 | | - list( $n, $arg ) = each( $this->preparedArgs ); |
| 790 | + list( /* $n */ , $arg ) = each( $this->preparedArgs ); |
791 | 791 | switch( $matches[1] ) { |
792 | 792 | case '?': return $this->addQuotes( $arg ); |
793 | 793 | case '!': return $arg; |
— | — | @@ -1091,7 +1091,7 @@ |
1092 | 1092 | $sql = preg_replace ('/".*"/s', "'X'", $sql); |
1093 | 1093 | |
1094 | 1094 | # All newlines, tabs, etc replaced by single space |
1095 | | - $sql = preg_replace ( "/\s+/", ' ', $sql); |
| 1095 | + $sql = preg_replace ( '/\s+/', ' ', $sql); |
1096 | 1096 | |
1097 | 1097 | # All numbers => N |
1098 | 1098 | $sql = preg_replace ('/-?[0-9]+/s', 'N', $sql); |
— | — | @@ -1558,7 +1558,8 @@ |
1559 | 1559 | $row = $this->fetchObject( $res ); |
1560 | 1560 | $this->freeResult( $res ); |
1561 | 1561 | |
1562 | | - if ( preg_match( "/\((.*)\)/", $row->Type, $m ) ) { |
| 1562 | + $m = array(); |
| 1563 | + if ( preg_match( '/\((.*)\)/', $row->Type, $m ) ) { |
1563 | 1564 | $size = $m[1]; |
1564 | 1565 | } else { |
1565 | 1566 | $size = -1; |
— | — | @@ -1882,7 +1883,6 @@ |
1883 | 1884 | $res = $this->query( 'SHOW PROCESSLIST' ); |
1884 | 1885 | # Find slave SQL thread. Assumed to be the second one running, which is a bit |
1885 | 1886 | # dubious, but unfortunately there's no easy rigorous way |
1886 | | - $slaveThreads = 0; |
1887 | 1887 | while ( $row = $this->fetchObject( $res ) ) { |
1888 | 1888 | /* This should work for most situations - when default db |
1889 | 1889 | * for thread is not specified, it had no events executed, |
Index: trunk/phase3/includes/MagicWord.php |
— | — | @@ -289,7 +289,7 @@ |
290 | 290 | * Used in matchAndRemove() |
291 | 291 | * @private |
292 | 292 | **/ |
293 | | - function pregRemoveAndRecord( $match ) { |
| 293 | + function pregRemoveAndRecord( ) { |
294 | 294 | $this->mFound = true; |
295 | 295 | return ''; |
296 | 296 | } |
Index: trunk/phase3/includes/ParserCache.php |
— | — | @@ -56,8 +56,6 @@ |
57 | 57 | $fname = 'ParserCache::get'; |
58 | 58 | wfProfileIn( $fname ); |
59 | 59 | |
60 | | - $hash = $user->getPageRenderingHash(); |
61 | | - $pageid = intval( $article->getID() ); |
62 | 60 | $key = $this->getKey( $article, $user ); |
63 | 61 | |
64 | 62 | wfDebug( "Trying parser cache $key\n" ); |
Index: trunk/phase3/includes/ProfilerSimple.php |
— | — | @@ -61,15 +61,13 @@ |
62 | 62 | } |
63 | 63 | |
64 | 64 | function profileOut($functionname) { |
65 | | - $memory = memory_get_usage(); |
66 | | - |
67 | 65 | global $wgDebugFunctionEntry; |
68 | 66 | |
69 | 67 | if ($wgDebugFunctionEntry) { |
70 | 68 | $this->debug(str_repeat(' ', count($this->mWorkStack) - 1).'Exiting '.$functionname."\n"); |
71 | 69 | } |
72 | 70 | |
73 | | - list($ofname,$ocount,$ortime,$octime) = array_pop($this->mWorkStack); |
| 71 | + list($ofname, /* $ocount */ ,$ortime,$octime) = array_pop($this->mWorkStack); |
74 | 72 | |
75 | 73 | if (!$ofname) { |
76 | 74 | $this->debug("Profiling error: $functionname\n"); |
Index: trunk/phase3/includes/HistoryBlob.php |
— | — | @@ -226,7 +226,7 @@ |
227 | 227 | $flags = explode( ',', $row->old_flags ); |
228 | 228 | if( in_array( 'external', $flags ) ) { |
229 | 229 | $url=$row->old_text; |
230 | | - @list($proto,$path)=explode('://',$url,2); |
| 230 | + @list( /* $proto */ ,$path)=explode('://',$url,2); |
231 | 231 | if ($path=="") { |
232 | 232 | wfProfileOut( $fname ); |
233 | 233 | return false; |
Index: trunk/phase3/includes/ImageFunctions.php |
— | — | @@ -126,6 +126,7 @@ |
127 | 127 | '' => 1.0, // "User units" pixels by default |
128 | 128 | '%' => 2.0, // Fake it! |
129 | 129 | ); |
| 130 | + $matches = array(); |
130 | 131 | if( preg_match( '/^(\d+(?:\.\d+)?)(em|ex|px|pt|pc|cm|mm|in|%|)$/', $length, $matches ) ) { |
131 | 132 | $length = floatval( $matches[1] ); |
132 | 133 | $unit = $matches[2]; |
— | — | @@ -156,6 +157,7 @@ |
157 | 158 | fclose( $f ); |
158 | 159 | |
159 | 160 | // Uber-crappy hack! Run through a real XML parser. |
| 161 | + $matches = array(); |
160 | 162 | if( !preg_match( '/<svg\s*([^>]*)\s*>/s', $chunk, $matches ) ) { |
161 | 163 | return false; |
162 | 164 | } |
— | — | @@ -206,6 +208,7 @@ |
207 | 209 | } |
208 | 210 | |
209 | 211 | # Find all links |
| 212 | + $m = array(); |
210 | 213 | if ( !preg_match_all( '/\[\[:?(.*?)\]\]/', $line, $m ) ) { |
211 | 214 | continue; |
212 | 215 | } |
Index: trunk/phase3/includes/WikiError.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | * @return bool |
61 | 61 | * @static |
62 | 62 | */ |
63 | | - public static function isError( &$object ) { |
| 63 | + public static function isError( $object ) { |
64 | 64 | return $object instanceof WikiError; |
65 | 65 | } |
66 | 66 | } |
Index: trunk/phase3/includes/SearchMySQL4.php |
— | — | @@ -43,6 +43,7 @@ |
44 | 44 | $this->searchTerms = array(); |
45 | 45 | |
46 | 46 | # FIXME: This doesn't handle parenthetical expressions. |
| 47 | + $m = array(); |
47 | 48 | if( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/', |
48 | 49 | $filteredText, $m, PREG_SET_ORDER ) ) { |
49 | 50 | foreach( $m as $terms ) { |
— | — | @@ -60,7 +61,7 @@ |
61 | 62 | $this->searchTerms[] = $regexp; |
62 | 63 | } |
63 | 64 | wfDebug( "Would search with '$searchon'\n" ); |
64 | | - wfDebug( "Match with /\b" . implode( '\b|\b', $this->searchTerms ) . "\b/\n" ); |
| 65 | + wfDebug( 'Match with /\b' . implode( '\b|\b', $this->searchTerms ) . "\b/\n" ); |
65 | 66 | } else { |
66 | 67 | wfDebug( "Can't understand search query '{$filteredText}'\n" ); |
67 | 68 | } |
Index: trunk/phase3/includes/SpecialVersion.php |
— | — | @@ -281,8 +281,6 @@ |
282 | 282 | // subversion is release 1.4 |
283 | 283 | return intval( $content[3] ); |
284 | 284 | } |
285 | | - |
286 | | - return false; |
287 | 285 | } |
288 | 286 | |
289 | 287 | /**#@-*/ |
Index: trunk/phase3/includes/StringUtils.php |
— | — | @@ -50,7 +50,8 @@ |
51 | 51 | $encEnd = preg_quote( $endDelim, '!' ); |
52 | 52 | $strcmp = strpos( $flags, 'i' ) === false ? 'strcmp' : 'strcasecmp'; |
53 | 53 | $endLength = strlen( $endDelim ); |
54 | | - |
| 54 | + $m = array(); |
| 55 | + |
55 | 56 | while ( $inputPos < strlen( $subject ) && |
56 | 57 | preg_match( "!($encStart)|($encEnd)!S$flags", $subject, $m, PREG_OFFSET_CAPTURE, $inputPos ) ) |
57 | 58 | { |
Index: trunk/phase3/includes/FileStore.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | $dbw = wfGetDB( DB_MASTER ); |
59 | 59 | $lockname = $dbw->addQuotes( FileStore::lockName() ); |
60 | 60 | $result = $dbw->query( "SELECT RELEASE_LOCK($lockname)", __METHOD__ ); |
61 | | - $row = $dbw->fetchObject( $result ); |
| 61 | + $dbw->fetchObject( $result ); |
62 | 62 | $dbw->freeResult( $result ); |
63 | 63 | } |
64 | 64 | |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -148,7 +148,8 @@ |
149 | 149 | // adding of CSS or Javascript by extensions. |
150 | 150 | wfRunHooks( 'BeforePageDisplay', array( &$out ) ); |
151 | 151 | |
152 | | - extract( $wgRequest->getValues( 'oldid', 'diff' ) ); |
| 152 | + $oldid = $wgRequest->getVal( 'oldid' ); |
| 153 | + $diff = $wgRequest->getVal( 'diff' ); |
153 | 154 | |
154 | 155 | wfProfileIn( "$fname-init" ); |
155 | 156 | $this->initPage( $out ); |
— | — | @@ -768,9 +769,6 @@ |
769 | 770 | $variants = $wgContLang->getVariants(); |
770 | 771 | if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) { |
771 | 772 | $preferred = $wgContLang->getPreferredVariant(); |
772 | | - $actstr = ''; |
773 | | - if( $action ) |
774 | | - $actstr = 'action=' . $action . '&'; |
775 | 773 | $vcount=0; |
776 | 774 | foreach( $variants as $code ) { |
777 | 775 | $varname = $wgContLang->getVariantname( $code ); |
— | — | @@ -810,7 +808,6 @@ |
811 | 809 | |
812 | 810 | $action = $wgRequest->getText( 'action' ); |
813 | 811 | $oldid = $wgRequest->getVal( 'oldid' ); |
814 | | - $diff = $wgRequest->getVal( 'diff' ); |
815 | 812 | |
816 | 813 | $nav_urls = array(); |
817 | 814 | $nav_urls['mainpage'] = array( 'href' => self::makeI18nUrl( 'mainpage') ); |
Index: trunk/phase3/includes/SpecialUndelete.php |
— | — | @@ -348,7 +348,6 @@ |
349 | 349 | } |
350 | 350 | |
351 | 351 | $revision = null; |
352 | | - $newRevId = $previousRevId; |
353 | 352 | $restored = 0; |
354 | 353 | |
355 | 354 | while( $row = $dbw->fetchObject( $result ) ) { |
— | — | @@ -375,7 +374,7 @@ |
376 | 375 | 'minor_edit' => $row->ar_minor_edit, |
377 | 376 | 'text_id' => $row->ar_text_id, |
378 | 377 | ) ); |
379 | | - $newRevId = $revision->insertOn( $dbw ); |
| 378 | + $revision->insertOn( $dbw ); |
380 | 379 | $restored++; |
381 | 380 | } |
382 | 381 | |
— | — | @@ -594,8 +593,8 @@ |
595 | 594 | } |
596 | 595 | |
597 | 596 | $archive = new PageArchive( $this->mTargetObj ); |
598 | | - $text = $archive->getLastRevisionText(); |
599 | 597 | /* |
| 598 | + $text = $archive->getLastRevisionText(); |
600 | 599 | if( is_null( $text ) ) { |
601 | 600 | $wgOut->addWikiText( wfMsg( "nohistory" ) ); |
602 | 601 | return; |
— | — | @@ -739,7 +738,6 @@ |
740 | 739 | global $wgOut, $wgUser; |
741 | 740 | if( !is_null( $this->mTargetObj ) ) { |
742 | 741 | $archive = new PageArchive( $this->mTargetObj ); |
743 | | - $ok = true; |
744 | 742 | |
745 | 743 | $ok = $archive->undelete( |
746 | 744 | $this->mTargetTimestamp, |
Index: trunk/phase3/includes/HTMLCacheUpdate.php |
— | — | @@ -55,7 +55,6 @@ |
56 | 56 | $numRows = $res->numRows(); |
57 | 57 | $numBatches = ceil( $numRows / $this->mRowsPerJob ); |
58 | 58 | $realBatchSize = $numRows / $numBatches; |
59 | | - $boundaries = array(); |
60 | 59 | $start = false; |
61 | 60 | $jobs = array(); |
62 | 61 | do { |
Index: trunk/phase3/includes/SpecialAllmessages.php |
— | — | @@ -28,7 +28,6 @@ |
29 | 29 | # Make sure all extension messages are available |
30 | 30 | MessageCache::loadAllMessages(); |
31 | 31 | |
32 | | - $first = true; |
33 | 32 | $sortedArray = array_merge( Language::getMessagesFor( 'en' ), $wgMessageCache->getExtensionMessagesFor( 'en' ) ); |
34 | 33 | ksort( $sortedArray ); |
35 | 34 | $messages = array(); |
— | — | @@ -75,7 +74,7 @@ |
76 | 75 | } else { |
77 | 76 | $comment = ''; |
78 | 77 | } |
79 | | - $txt .= "'$key' => '" . preg_replace( "/(?<!\\\\)'/", "\'", $m['msg']) . "',$comment\n"; |
| 78 | + $txt .= "'$key' => '" . preg_replace( '/(?<!\\\\)\'/', "\'", $m['msg']) . "',$comment\n"; |
80 | 79 | } |
81 | 80 | $txt .= ');'; |
82 | 81 | return $txt; |
— | — | @@ -92,8 +91,6 @@ |
93 | 92 | |
94 | 93 | $sk =& $wgUser->getSkin(); |
95 | 94 | $talk = $wgLang->getNsText( NS_TALK ); |
96 | | - $mwnspace = $wgLang->getNsText( NS_MEDIAWIKI ); |
97 | | - $mwtalk = $wgLang->getNsText( NS_MEDIAWIKI_TALK ); |
98 | 95 | |
99 | 96 | $input = wfElement( 'input', array( |
100 | 97 | 'type' => 'text', |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -48,6 +48,7 @@ |
49 | 49 | # while code from www.php.net |
50 | 50 | while (false !== ($file = $skinDir->read())) { |
51 | 51 | // Skip non-PHP files, hidden files, and '.dep' includes |
| 52 | + $matches = array(); |
52 | 53 | if(preg_match('/^([^.]*)\.php$/',$file, $matches)) { |
53 | 54 | $aSkin = $matches[1]; |
54 | 55 | $wgValidSkinNames[strtolower($aSkin)] = $aSkin; |
— | — | @@ -369,7 +370,6 @@ |
370 | 371 | function getUserStylesheet() { |
371 | 372 | global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion; |
372 | 373 | $sheet = $this->getStylesheet(); |
373 | | - $action = $wgRequest->getText('action'); |
374 | 374 | $s = "@import \"$wgStylePath/common/common.css?$wgStyleVersion\";\n"; |
375 | 375 | $s .= "@import \"$wgStylePath/$sheet?$wgStyleVersion\";\n"; |
376 | 376 | if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css?$wgStyleVersion\";\n"; |
— | — | @@ -490,7 +490,6 @@ |
491 | 491 | else $a = array( 'bgcolor' => '#FFFFFF' ); |
492 | 492 | if($wgOut->isArticle() && $wgUser->getOption('editondblclick') && |
493 | 493 | $wgTitle->userCanEdit() ) { |
494 | | - $t = wfMsg( 'editthispage' ); |
495 | 494 | $s = $wgTitle->getFullURL( $this->editUrlOptions() ); |
496 | 495 | $s = 'document.location = "' .wfEscapeJSString( $s ) .'";'; |
497 | 496 | $a += array ('ondblclick' => $s); |
— | — | @@ -696,7 +695,8 @@ |
697 | 696 | function pageTitleLinks() { |
698 | 697 | global $wgOut, $wgTitle, $wgUser, $wgRequest; |
699 | 698 | |
700 | | - extract( $wgRequest->getValues( 'oldid', 'diff' ) ); |
| 699 | + $oldid = $wgRequest->getVal( 'oldid' ); |
| 700 | + $diff = $wgRequest->getVal( 'diff' ); |
701 | 701 | $action = $wgRequest->getText( 'action' ); |
702 | 702 | |
703 | 703 | $s = $this->printableLink(); |
— | — | @@ -838,7 +838,6 @@ |
839 | 839 | function nameAndLogin() { |
840 | 840 | global $wgUser, $wgTitle, $wgLang, $wgContLang, $wgShowIPinHeader; |
841 | 841 | |
842 | | - $li = $wgContLang->specialPage( 'Userlogin' ); |
843 | 842 | $lo = $wgContLang->specialPage( 'Userlogout' ); |
844 | 843 | |
845 | 844 | $s = ''; |
— | — | @@ -1011,7 +1010,8 @@ |
1012 | 1011 | global $wgOut, $wgLang, $wgArticle, $wgRequest, $wgUser; |
1013 | 1012 | global $wgDisableCounters, $wgMaxCredits, $wgShowCreditsIfMax, $wgTitle, $wgPageShowWatchingUsers; |
1014 | 1013 | |
1015 | | - extract( $wgRequest->getValues( 'oldid', 'diff' ) ); |
| 1014 | + $oldid = $wgRequest->getVal( 'oldid' ); |
| 1015 | + $diff = $wgRequest->getVal( 'diff' ); |
1016 | 1016 | if ( ! $wgOut->isArticle() ) { return ''; } |
1017 | 1017 | if ( isset( $oldid ) || isset( $diff ) ) { return ''; } |
1018 | 1018 | if ( 0 == $wgArticle->getID() ) { return ''; } |
— | — | @@ -1144,7 +1144,6 @@ |
1145 | 1145 | */ |
1146 | 1146 | function specialPagesList() { |
1147 | 1147 | global $wgUser, $wgContLang, $wgServer, $wgRedirectScript; |
1148 | | - $a = array(); |
1149 | 1148 | $pages = array_merge( SpecialPage::getRegularPages(), SpecialPage::getRestrictedPages() ); |
1150 | 1149 | foreach ( $pages as $name => $page ) { |
1151 | 1150 | $pages[$name] = $page->getDescription(); |
— | — | @@ -1629,7 +1628,7 @@ |
1630 | 1629 | } |
1631 | 1630 | } |
1632 | 1631 | if ($cacheSidebar) |
1633 | | - $cachednotice = $parserMemc->set( $key, $bar, 86400 ); |
| 1632 | + $parserMemc->set( $key, $bar, 86400 ); |
1634 | 1633 | wfProfileOut( $fname ); |
1635 | 1634 | return $bar; |
1636 | 1635 | } |
Index: trunk/phase3/includes/DjVuImage.php |
— | — | @@ -217,7 +217,7 @@ |
218 | 218 | global $wgDjvuToXML; |
219 | 219 | if ( isset( $wgDjvuToXML ) ) { |
220 | 220 | $cmd = $wgDjvuToXML . ' --without-anno --without-text ' . $this->mFilename; |
221 | | - $xml = wfShellExec( $cmd, $retval ); |
| 221 | + $xml = wfShellExec( $cmd ); |
222 | 222 | } else { |
223 | 223 | $xml = null; |
224 | 224 | } |
Index: trunk/phase3/includes/SpecialRandompage.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * used as e.g. Special:Randompage/Category |
13 | 13 | */ |
14 | 14 | function wfSpecialRandompage( $par = NS_MAIN ) { |
15 | | - global $wgOut, $wgExtraRandompageSQL, $wgContLang, $wgLang; |
| 15 | + global $wgOut, $wgExtraRandompageSQL; |
16 | 16 | $fname = 'wfSpecialRandompage'; |
17 | 17 | |
18 | 18 | # Determine namespace |
Index: trunk/phase3/includes/SpecialIpblocklist.php |
— | — | @@ -167,6 +167,7 @@ |
168 | 168 | } |
169 | 169 | |
170 | 170 | $conds = array(); |
| 171 | + $matches = array(); |
171 | 172 | if ( $this->ip == '' ) { |
172 | 173 | // No extra conditions |
173 | 174 | } elseif ( substr( $this->ip, 0, 1 ) == '#' ) { |
— | — | @@ -174,7 +175,7 @@ |
175 | 176 | } elseif ( IP::toUnsigned( $this->ip ) !== false ) { |
176 | 177 | $conds['ipb_address'] = $this->ip; |
177 | 178 | $conds['ipb_auto'] = 0; |
178 | | - } elseif( preg_match( "/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\\/(\\d{1,2})$/", $this->ip, $matches ) ) { |
| 179 | + } elseif( preg_match( '/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\\/(\\d{1,2})$/', $this->ip, $matches ) ) { |
179 | 180 | $conds['ipb_address'] = Block::normaliseRange( $this->ip ); |
180 | 181 | $conds['ipb_auto'] = 0; |
181 | 182 | } else { |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -1625,15 +1625,15 @@ |
1626 | 1626 | */ |
1627 | 1627 | $toolarray=array( |
1628 | 1628 | array( 'image'=>'button_bold.png', |
1629 | | - 'open' => "\'\'\'", |
1630 | | - 'close' => "\'\'\'", |
| 1629 | + 'open' => '\\\'\\\'\\\'', |
| 1630 | + 'close' => '\\\'\\\'\\\'', |
1631 | 1631 | 'sample'=> wfMsg('bold_sample'), |
1632 | 1632 | 'tip' => wfMsg('bold_tip'), |
1633 | 1633 | 'key' => 'B' |
1634 | 1634 | ), |
1635 | 1635 | array( 'image'=>'button_italic.png', |
1636 | | - 'open' => "\'\'", |
1637 | | - 'close' => "\'\'", |
| 1636 | + 'open' => '\\\'\\\'', |
| 1637 | + 'close' => '\\\'\\\'', |
1638 | 1638 | 'sample'=> wfMsg('italic_sample'), |
1639 | 1639 | 'tip' => wfMsg('italic_tip'), |
1640 | 1640 | 'key' => 'I' |
Index: trunk/phase3/includes/SpecialLog.php |
— | — | @@ -151,7 +151,6 @@ |
152 | 152 | */ |
153 | 153 | function getQuery() { |
154 | 154 | $logging = $this->db->tableName( "logging" ); |
155 | | - $user = $this->db->tableName( 'user' ); |
156 | 155 | $sql = "SELECT /*! STRAIGHT_JOIN */ log_type, log_action, log_timestamp, |
157 | 156 | log_user, user_name, |
158 | 157 | log_namespace, log_title, page_id, |
— | — | @@ -304,7 +303,6 @@ |
305 | 304 | function logLine( $s ) { |
306 | 305 | global $wgLang; |
307 | 306 | $title = Title::makeTitle( $s->log_namespace, $s->log_title ); |
308 | | - $user = Title::makeTitleSafe( NS_USER, $s->user_name ); |
309 | 307 | $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $s->log_timestamp), true ); |
310 | 308 | |
311 | 309 | // Enter the existence or non-existence of this page into the link cache, |
Index: trunk/phase3/includes/SpecialDisambiguations.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | |
34 | 34 | function getSQL() { |
35 | 35 | $dbr =& wfGetDB( DB_SLAVE ); |
36 | | - extract( $dbr->tableNames( 'page', 'pagelinks', 'templatelinks' ) ); |
| 36 | + list( $page, $pagelinks, $templatelinks) = $dbr->tableNamesN( 'page', 'pagelinks', 'templatelinks' ); |
37 | 37 | |
38 | 38 | $dMsgText = wfMsgForContent('disambiguationspage'); |
39 | 39 | |
Index: trunk/phase3/includes/Hooks.php |
— | — | @@ -31,7 +31,6 @@ |
32 | 32 | function wfRunHooks($event, $args = null) { |
33 | 33 | |
34 | 34 | global $wgHooks; |
35 | | - $fname = 'wfRunHooks'; |
36 | 35 | |
37 | 36 | if (!is_array($wgHooks)) { |
38 | 37 | throw new MWException("Global hooks array is not an array!\n"); |
Index: trunk/phase3/includes/Math.php |
— | — | @@ -75,12 +75,13 @@ |
76 | 76 | $retval = substr ($contents, 0, 1); |
77 | 77 | $errmsg = ''; |
78 | 78 | if (($retval == 'C') || ($retval == 'M') || ($retval == 'L')) { |
79 | | - if ($retval == 'C') |
| 79 | + if ($retval == 'C') { |
80 | 80 | $this->conservativeness = 2; |
81 | | - else if ($retval == 'M') |
| 81 | + } else if ($retval == 'M') { |
82 | 82 | $this->conservativeness = 1; |
83 | | - else |
| 83 | + } else { |
84 | 84 | $this->conservativeness = 0; |
| 85 | + } |
85 | 86 | $outdata = substr ($contents, 33); |
86 | 87 | |
87 | 88 | $i = strpos($outdata, "\000"); |
— | — | @@ -89,12 +90,13 @@ |
90 | 91 | $this->mathml = substr($outdata, $i+1); |
91 | 92 | } else if (($retval == 'c') || ($retval == 'm') || ($retval == 'l')) { |
92 | 93 | $this->html = substr ($contents, 33); |
93 | | - if ($retval == 'c') |
| 94 | + if ($retval == 'c') { |
94 | 95 | $this->conservativeness = 2; |
95 | | - else if ($retval == 'm') |
| 96 | + } else if ($retval == 'm') { |
96 | 97 | $this->conservativeness = 1; |
97 | | - else |
| 98 | + } else { |
98 | 99 | $this->conservativeness = 0; |
| 100 | + } |
99 | 101 | $this->mathml = NULL; |
100 | 102 | } else if ($retval == 'X') { |
101 | 103 | $this->html = NULL; |
— | — | @@ -118,7 +120,7 @@ |
119 | 121 | $this->hash = substr ($contents, 1, 32); |
120 | 122 | } |
121 | 123 | |
122 | | - $res = wfRunHooks( 'MathAfterTexvc', array( &$this, &$errmsg ) ); |
| 124 | + wfRunHooks( 'MathAfterTexvc', array( &$this, &$errmsg ) ); |
123 | 125 | |
124 | 126 | if ( $errmsg ) { |
125 | 127 | return $errmsg; |
Index: trunk/phase3/includes/ImageGallery.php |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | * |
136 | 136 | */ |
137 | 137 | function toHTML() { |
138 | | - global $wgLang, $wgIgnoreImageErrors, $wgGenerateThumbnailOnParse; |
| 138 | + global $wgLang, $wgGenerateThumbnailOnParse; |
139 | 139 | |
140 | 140 | $sk = $this->getSkin(); |
141 | 141 | |
— | — | @@ -147,7 +147,6 @@ |
148 | 148 | $img =& $pair[0]; |
149 | 149 | $text = $pair[1]; |
150 | 150 | |
151 | | - $name = $img->getName(); |
152 | 151 | $nt = $img->getTitle(); |
153 | 152 | |
154 | 153 | if( $nt->getNamespace() != NS_IMAGE ) { |
Index: trunk/phase3/includes/AjaxResponse.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | } |
63 | 63 | |
64 | 64 | function sendHeaders() { |
65 | | - global $wgUseSquid, $wgUseESI, $wgSquidMaxage; |
| 65 | + global $wgUseSquid, $wgUseESI; |
66 | 66 | |
67 | 67 | if ( $this->mResponseCode ) { |
68 | 68 | $n = preg_replace( '/^ *(\d+)/', '\1', $this->mResponseCode ); |
— | — | @@ -122,7 +122,7 @@ |
123 | 123 | * returns true iff the response code was set to 304 Not Modified. |
124 | 124 | */ |
125 | 125 | function checkLastModified ( $timestamp ) { |
126 | | - global $wgCachePages, $wgCacheEpoch, $wgUser, $wgRequest; |
| 126 | + global $wgCachePages, $wgCacheEpoch, $wgUser; |
127 | 127 | $fname = 'AjaxResponse::checkLastModified'; |
128 | 128 | |
129 | 129 | if ( !$timestamp || $timestamp == '19700101000000' ) { |
Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | * Load some values |
36 | 36 | */ |
37 | 37 | function PreferencesForm( &$request ) { |
38 | | - global $wgLang, $wgContLang, $wgUser, $wgAllowRealName; |
| 38 | + global $wgContLang, $wgUser, $wgAllowRealName; |
39 | 39 | |
40 | 40 | $this->mQuickbar = $request->getVal( 'wpQuickbar' ); |
41 | 41 | $this->mOldpass = $request->getVal( 'wpOldpass' ); |
— | — | @@ -378,7 +378,6 @@ |
379 | 379 | |
380 | 380 | $togs = User::getToggles(); |
381 | 381 | foreach ( $togs as $tname ) { |
382 | | - $ttext = wfMsg('tog-'.$tname); |
383 | 382 | $this->mToggles[$tname] = $wgUser->getOption( $tname ); |
384 | 383 | } |
385 | 384 | |
— | — | @@ -526,8 +525,6 @@ |
527 | 526 | $enotifusertalkpages = ($wgEnotifUserTalk) ? $this->getToggle( 'enotifusertalkpages', false, $disableEmailPrefs ) : ''; |
528 | 527 | $enotifminoredits = ($wgEnotifWatchlist && $wgEnotifMinorEdits) ? $this->getToggle( 'enotifminoredits', false, $disableEmailPrefs ) : ''; |
529 | 528 | $enotifrevealaddr = (($wgEnotifWatchlist || $wgEnotifUserTalk) && $wgEnotifRevealEditorAddress) ? $this->getToggle( 'enotifrevealaddr', false, $disableEmailPrefs ) : ''; |
530 | | - $prefs_help_email_enotif = ( $wgEnotifWatchlist || $wgEnotifUserTalk) ? ' ' . wfMsg('prefs-help-email-enotif') : ''; |
531 | | - $prefs_help_realname = ''; |
532 | 529 | |
533 | 530 | # </FIXME> |
534 | 531 | |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -109,8 +109,6 @@ |
110 | 110 | * @access public |
111 | 111 | */ |
112 | 112 | public static function newFromText( $text, $defaultNamespace = NS_MAIN ) { |
113 | | - $fname = 'Title::newFromText'; |
114 | | - |
115 | 113 | if( is_object( $text ) ) { |
116 | 114 | throw new MWException( 'Title::newFromText given an object' ); |
117 | 115 | } |
— | — | @@ -289,6 +287,7 @@ |
290 | 288 | $mwRedir = MagicWord::get( 'redirect' ); |
291 | 289 | $rt = NULL; |
292 | 290 | if ( $mwRedir->matchStart( $text ) ) { |
| 291 | + $m = array(); |
293 | 292 | if ( preg_match( '/\[{2}(.*?)(?:\||\]{2})/', $text, $m ) ) { |
294 | 293 | # categories are escaped using : for example one can enter: |
295 | 294 | # #REDIRECT [[:Category:Music]]. Need to remove it. |
— | — | @@ -859,6 +858,7 @@ |
860 | 859 | } else { |
861 | 860 | global $wgActionPaths; |
862 | 861 | $url = false; |
| 862 | + $matches = array(); |
863 | 863 | if( !empty( $wgActionPaths ) && |
864 | 864 | preg_match( '/^(.*&|)action=([^&]*)(&(.*)|)$/', $query, $matches ) ) |
865 | 865 | { |
— | — | @@ -1429,7 +1429,6 @@ |
1430 | 1430 | */ |
1431 | 1431 | /* private */ function secureAndSplit() { |
1432 | 1432 | global $wgContLang, $wgLocalInterwiki, $wgCapitalLinks; |
1433 | | - $fname = 'Title::secureAndSplit'; |
1434 | 1433 | |
1435 | 1434 | # Initialisation |
1436 | 1435 | static $rxTc = false; |
— | — | @@ -1467,6 +1466,7 @@ |
1468 | 1467 | # Namespace or interwiki prefix |
1469 | 1468 | $firstPass = true; |
1470 | 1469 | do { |
| 1470 | + $m = array(); |
1471 | 1471 | if ( preg_match( "/^(.+?)_*:_*(.*)$/S", $t, $m ) ) { |
1472 | 1472 | $p = $m[1]; |
1473 | 1473 | $lowerNs = $wgContLang->lc( $p ); |
— | — | @@ -1628,7 +1628,6 @@ |
1629 | 1629 | */ |
1630 | 1630 | function getLinksTo( $options = '', $table = 'pagelinks', $prefix = 'pl' ) { |
1631 | 1631 | $linkCache =& LinkCache::singleton(); |
1632 | | - $id = $this->getArticleID(); |
1633 | 1632 | |
1634 | 1633 | if ( $options ) { |
1635 | 1634 | $db =& wfGetDB( DB_MASTER ); |
— | — | @@ -1899,7 +1898,6 @@ |
1900 | 1899 | } |
1901 | 1900 | |
1902 | 1901 | $now = wfTimestampNow(); |
1903 | | - $rand = wfRandom(); |
1904 | 1902 | $newid = $nt->getArticleID(); |
1905 | 1903 | $oldid = $this->getArticleID(); |
1906 | 1904 | $dbw =& wfGetDB( DB_MASTER ); |
— | — | @@ -1937,7 +1935,7 @@ |
1938 | 1936 | 'page' => $newid, |
1939 | 1937 | 'comment' => $comment, |
1940 | 1938 | 'text' => $redirectText ) ); |
1941 | | - $revid = $redirectRevision->insertOn( $dbw ); |
| 1939 | + $redirectRevision->insertOn( $dbw ); |
1942 | 1940 | $redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 ); |
1943 | 1941 | $linkCache->clearLink( $this->getPrefixedDBkey() ); |
1944 | 1942 | |
— | — | @@ -1980,7 +1978,6 @@ |
1981 | 1979 | $oldid = $this->getArticleID(); |
1982 | 1980 | $dbw =& wfGetDB( DB_MASTER ); |
1983 | 1981 | $now = $dbw->timestamp(); |
1984 | | - $rand = wfRandom(); |
1985 | 1982 | $linkCache =& LinkCache::singleton(); |
1986 | 1983 | |
1987 | 1984 | # Save a null revision in the page's history notifying of the move |
— | — | @@ -2010,7 +2007,7 @@ |
2011 | 2008 | 'page' => $newid, |
2012 | 2009 | 'comment' => $comment, |
2013 | 2010 | 'text' => $redirectText ) ); |
2014 | | - $revid = $redirectRevision->insertOn( $dbw ); |
| 2011 | + $redirectRevision->insertOn( $dbw ); |
2015 | 2012 | $redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 ); |
2016 | 2013 | $linkCache->clearLink( $this->getPrefixedDBkey() ); |
2017 | 2014 | |
— | — | @@ -2062,6 +2059,7 @@ |
2063 | 2060 | |
2064 | 2061 | # Does the redirect point to the source? |
2065 | 2062 | # Or is it a broken self-redirect, usually caused by namespace collisions? |
| 2063 | + $m = array(); |
2066 | 2064 | if ( preg_match( "/\\[\\[\\s*([^\\]\\|]*)]]/", $text, $m ) ) { |
2067 | 2065 | $redirTitle = Title::newFromText( $m[1] ); |
2068 | 2066 | if( !is_object( $redirTitle ) || |
— | — | @@ -2113,7 +2111,7 @@ |
2114 | 2112 | 'comment' => $comment, |
2115 | 2113 | 'text' => "#REDIRECT [[" . $dest->getPrefixedText() . "]]\n", |
2116 | 2114 | ) ); |
2117 | | - $revisionId = $revision->insertOn( $dbw ); |
| 2115 | + $revision->insertOn( $dbw ); |
2118 | 2116 | $article->updateRevisionOn( $dbw, $revision, 0 ); |
2119 | 2117 | |
2120 | 2118 | # Link table |
— | — | @@ -2372,7 +2370,7 @@ |
2373 | 2371 | */ |
2374 | 2372 | function isSpecial( $name ) { |
2375 | 2373 | if ( $this->getNamespace() == NS_SPECIAL ) { |
2376 | | - list( $thisName, $subpage ) = SpecialPage::resolveAliasWithSubpage( $this->getDBkey() ); |
| 2374 | + list( $thisName, /* $subpage */ ) = SpecialPage::resolveAliasWithSubpage( $this->getDBkey() ); |
2377 | 2375 | if ( $name == $thisName ) { |
2378 | 2376 | return true; |
2379 | 2377 | } |
Index: trunk/phase3/includes/Image.php |
— | — | @@ -235,7 +235,7 @@ |
236 | 236 | * Load metadata from the file itself |
237 | 237 | */ |
238 | 238 | function loadFromFile() { |
239 | | - global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang, $wgShowEXIF; |
| 239 | + global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang; |
240 | 240 | wfProfileIn( __METHOD__ ); |
241 | 241 | $this->imagePath = $this->getFullPath(); |
242 | 242 | $this->fileExists = file_exists( $this->imagePath ); |
— | — | @@ -925,7 +925,7 @@ |
926 | 926 | if ( !$this->mustRender() && $width == $this->width && $height == $this->height ) { |
927 | 927 | $url = $this->getURL(); |
928 | 928 | } else { |
929 | | - list( $isScriptUrl, $url ) = $this->thumbUrl( $width ); |
| 929 | + list( /* $isScriptUrl */, $url ) = $this->thumbUrl( $width ); |
930 | 930 | } |
931 | 931 | $thumb = new ThumbnailImage( $url, $width, $height ); |
932 | 932 | } else { |
— | — | @@ -1360,8 +1360,9 @@ |
1361 | 1361 | $dir = wfImageThumbDir( $this->name, $shared ); |
1362 | 1362 | $urls = array(); |
1363 | 1363 | foreach ( $files as $file ) { |
| 1364 | + $m = array(); |
1364 | 1365 | if ( preg_match( '/^(\d+)px/', $file, $m ) ) { |
1365 | | - list( $isScriptUrl, $url ) = $this->thumbUrl( $m[1] ); |
| 1366 | + list( /* $isScriptUrl */, $url ) = $this->thumbUrl( $m[1] ); |
1366 | 1367 | $urls[] = $url; |
1367 | 1368 | @unlink( "$dir/$file" ); |
1368 | 1369 | } |
Index: trunk/phase3/includes/SpecialExport.php |
— | — | @@ -30,11 +30,6 @@ |
31 | 31 | global $wgExportAllowHistory, $wgExportMaxHistory; |
32 | 32 | |
33 | 33 | $curonly = true; |
34 | | - $fullHistory = array( |
35 | | - 'dir' => 'asc', |
36 | | - 'offset' => false, |
37 | | - 'limit' => $wgExportMaxHistory, |
38 | | - ); |
39 | 34 | if( $wgRequest->wasPosted() ) { |
40 | 35 | $page = $wgRequest->getText( 'pages' ); |
41 | 36 | $curonly = $wgRequest->getCheck( 'curonly' ); |
Index: trunk/phase3/includes/SpecialPrefixindex.php |
— | — | @@ -97,7 +97,6 @@ |
98 | 98 | $n = 0; |
99 | 99 | $out = '<table style="background: inherit;" border="0" width="100%">'; |
100 | 100 | |
101 | | - $namespaces = $wgContLang->getFormattedNamespaces(); |
102 | 101 | while( ($n < $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) { |
103 | 102 | $t = Title::makeTitle( $s->page_namespace, $s->page_title ); |
104 | 103 | if( $t ) { |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -532,7 +532,7 @@ |
533 | 533 | # Use external methods for external objects, text in table is URL-only then |
534 | 534 | if ( in_array( 'external', $flags ) ) { |
535 | 535 | $url=$text; |
536 | | - @list($proto,$path)=explode('://',$url,2); |
| 536 | + @list(/* $proto */,$path)=explode('://',$url,2); |
537 | 537 | if ($path=="") { |
538 | 538 | wfProfileOut( $fname ); |
539 | 539 | return false; |
Index: trunk/phase3/includes/User.php |
— | — | @@ -2133,6 +2133,7 @@ |
2134 | 2134 | */ |
2135 | 2135 | function sendConfirmationMail() { |
2136 | 2136 | global $wgContLang; |
| 2137 | + $expiration = null; // gets passed-by-ref and defined in next line. |
2137 | 2138 | $url = $this->confirmationTokenUrl( $expiration ); |
2138 | 2139 | return $this->sendMail( wfMsg( 'confirmemail_subject' ), |
2139 | 2140 | wfMsg( 'confirmemail_body', |
Index: trunk/phase3/includes/SpecialImagelist.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | * |
11 | 11 | */ |
12 | 12 | function wfSpecialImagelist() { |
13 | | - global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgMiserMode; |
| 13 | + global $wgOut; |
14 | 14 | |
15 | 15 | $pager = new ImageListPager; |
16 | 16 | |
Index: trunk/phase3/includes/DifferenceEngine.php |
— | — | @@ -144,8 +144,6 @@ |
145 | 145 | } |
146 | 146 | |
147 | 147 | $sk = $wgUser->getSkin(); |
148 | | - $talk = $wgContLang->getNsText( NS_TALK ); |
149 | | - $contribs = wfMsg( 'contribslink' ); |
150 | 148 | |
151 | 149 | if ( $this->mNewRev->isCurrent() && $wgUser->isAllowed('rollback') ) { |
152 | 150 | $rollback = ' ' . $sk->generateRollback( $this->mNewRev ); |
— | — | @@ -901,7 +899,7 @@ |
902 | 900 | $ymids[$k] = $ymids[$k-1]; |
903 | 901 | break; |
904 | 902 | } |
905 | | - while (list ($junk, $y) = each($matches)) { |
| 903 | + while (list ( /* $junk */, $y) = each($matches)) { |
906 | 904 | if ($y > $this->seq[$k-1]) { |
907 | 905 | USE_ASSERTS && assert($y < $this->seq[$k]); |
908 | 906 | // Optimization: this is a common case: |
— | — | @@ -1619,6 +1617,7 @@ |
1620 | 1618 | $words[] = $line; |
1621 | 1619 | $stripped[] = $line; |
1622 | 1620 | } else { |
| 1621 | + $m = array(); |
1623 | 1622 | if (preg_match_all('/ ( [^\S\n]+ | [0-9_A-Za-z\x80-\xff]+ | . ) (?: (?!< \n) [^\S\n])? /xs', |
1624 | 1623 | $line, $m)) |
1625 | 1624 | { |
Index: trunk/phase3/includes/SpecialAllpages.php |
— | — | @@ -184,8 +184,6 @@ |
185 | 185 | * @param integer $namespace (Default NS_MAIN) |
186 | 186 | */ |
187 | 187 | function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) { |
188 | | - global $wgUser; |
189 | | - |
190 | 188 | $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) ); |
191 | 189 | $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) ); |
192 | 190 | $queryparams = ($namespace ? "namespace=$namespace" : ''); |
Index: trunk/phase3/includes/Block.php |
— | — | @@ -113,9 +113,6 @@ |
114 | 114 | $options = array(); |
115 | 115 | $db =& $this->getDBOptions( $options ); |
116 | 116 | |
117 | | - $ret = false; |
118 | | - $killed = false; |
119 | | - |
120 | 117 | if ( 0 == $user && $address == '' ) { |
121 | 118 | # Invalid user specification, not blocked |
122 | 119 | $this->clear(); |
Index: trunk/phase3/includes/DatabasePostgres.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | $failFunction = false, $flags = 0 ) |
20 | 20 | { |
21 | 21 | |
22 | | - global $wgOut, $wgDBprefix, $wgCommandLineMode; |
| 22 | + global $wgOut; |
23 | 23 | # Can't get a reference if it hasn't been set yet |
24 | 24 | if ( !isset( $wgOut ) ) { |
25 | 25 | $wgOut = NULL; |
— | — | @@ -60,7 +60,6 @@ |
61 | 61 | $this->mPassword = $password; |
62 | 62 | $this->mDBname = $dbName; |
63 | 63 | |
64 | | - $success = false; |
65 | 64 | $hstring=""; |
66 | 65 | if ($server!=false && $server!="") { |
67 | 66 | $hstring="host=$server "; |
— | — | @@ -87,12 +86,13 @@ |
88 | 87 | ## If this is the initial connection, setup the schema stuff and possibly create the user |
89 | 88 | if (defined('MEDIAWIKI_INSTALL')) { |
90 | 89 | global $wgDBname, $wgDBuser, $wgDBpassword, $wgDBsuperuser, $wgDBmwschema, |
91 | | - $wgDBts2schema, $wgDBts2locale; |
| 90 | + $wgDBts2schema; |
92 | 91 | print "OK</li>\n"; |
93 | 92 | |
94 | 93 | print "<li>Checking the version of Postgres..."; |
95 | 94 | $version = pg_fetch_result($this->doQuery("SELECT version()"),0,0); |
96 | | - if (!preg_match("/PostgreSQL (\d+\.\d+)(\S+)/", $version, $thisver)) { |
| 95 | + $thisver = array(); |
| 96 | + if (!preg_match('/PostgreSQL (\d+\.\d+)(\S+)/', $version, $thisver)) { |
97 | 97 | print "<b>FAILED</b> (could not determine the version)</li>\n"; |
98 | 98 | dieout("</ul>"); |
99 | 99 | } |
— | — | @@ -804,10 +804,10 @@ |
805 | 805 | $SQL = "INSERT INTO interwiki(iw_prefix,iw_url,iw_local) VALUES "; |
806 | 806 | while ( ! feof( $f ) ) { |
807 | 807 | $line = fgets($f,1024); |
808 | | - if (!preg_match("/^\s*(\(.+?),(\d)\)/", $line, $matches)) { |
| 808 | + $matches = array(); |
| 809 | + if (!preg_match('/^\s*(\(.+?),(\d)\)/', $line, $matches)) { |
809 | 810 | continue; |
810 | 811 | } |
811 | | - $yesno = $matches[2]; ## ? "'true'" : "'false'"; |
812 | 812 | $this->query("$SQL $matches[1],$matches[2])"); |
813 | 813 | } |
814 | 814 | print " (table interwiki successfully populated)...\n"; |
— | — | @@ -831,7 +831,7 @@ |
832 | 832 | return "E'$s[1]'"; |
833 | 833 | } |
834 | 834 | return "'" . pg_escape_string($s) . "'"; |
835 | | - return "E'" . pg_escape_string($s) . "'"; |
| 835 | + // Unreachable: return "E'" . pg_escape_string($s) . "'"; |
836 | 836 | } |
837 | 837 | |
838 | 838 | function quote_ident( $s ) { |