Index: trunk/extensions/OAI/OAIHarvest.php |
— | — | @@ -284,6 +284,7 @@ |
285 | 285 | } |
286 | 286 | |
287 | 287 | function getTimestamp( $time ) { |
| 288 | + $matches = array(); |
288 | 289 | if( preg_match( '/^(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/', $time, $matches ) ) { |
289 | 290 | return wfTimestamp( TS_MW, |
290 | 291 | $matches[1] . $matches[2] . $matches[3] . |
— | — | @@ -759,6 +760,7 @@ |
760 | 761 | */ |
761 | 762 | function oaiNodeMap( $parent, $map ) { |
762 | 763 | $callMap = array(); |
| 764 | + $textMap = array(); |
763 | 765 | foreach( $map as $key => $value ) { |
764 | 766 | if( is_int( $key ) ) { |
765 | 767 | $textMap[$value] = true; |
— | — | @@ -766,7 +768,8 @@ |
767 | 769 | $callMap[$key] = $value; |
768 | 770 | } |
769 | 771 | } |
770 | | - |
| 772 | + |
| 773 | + $data = array(); |
771 | 774 | foreach( $parent->childNodes as $node ) { |
772 | 775 | if( $node->nodeType == XML_ELEMENT_NODE ) { |
773 | 776 | $name = $node->nodeName; |
Index: trunk/extensions/OAI/OAIRepo_body.php |
— | — | @@ -162,6 +162,7 @@ |
163 | 163 | function validateDatestamp( $var ) { |
164 | 164 | if( isset( $this->_request[$var] ) ) { |
165 | 165 | $time = $this->_request[$var]; |
| 166 | + $matches = array(); |
166 | 167 | if( preg_match( '/^(\d\d\d\d)-(\d\d)-(\d\d)$/', $time, $matches ) ) { |
167 | 168 | return wfTimestamp( TS_UNIX, |
168 | 169 | $matches[1] . $matches[2] . $matches[3] . '000000' ); |
— | — | @@ -408,7 +409,9 @@ |
409 | 410 | if( !isset( $this->_request[$var] ) ) { |
410 | 411 | return null; |
411 | 412 | } |
| 413 | + $matches = array(); |
412 | 414 | if( preg_match( '/^([a-z_]+):(\d+)(?:|:(\d{14}))$/', $this->_request[$var], $matches ) ) { |
| 415 | + $token = array(); |
413 | 416 | $token['metadataPrefix'] = $matches[1]; |
414 | 417 | $token['resume'] = IntVal( $matches[2] ); |
415 | 418 | $token['until'] = isset( $matches[3] ) |
Index: trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php |
— | — | @@ -98,7 +98,8 @@ |
99 | 99 | |
100 | 100 | list( $extract, $badge ) = $this->getExtract( $title ); |
101 | 101 | $image = $this->getBadge( $title, $badge ); |
102 | | - |
| 102 | + |
| 103 | + $item = array(); |
103 | 104 | $item['Text']['*'] = $title->getPrefixedText(); |
104 | 105 | $item['Description']['*'] = $extract; |
105 | 106 | $item['Url']['*'] = $title->getFullUrl(); |
— | — | @@ -208,6 +209,7 @@ |
209 | 210 | $end = "(?:$endgroup)"; |
210 | 211 | $sentence = ".*?$end+"; |
211 | 212 | $firstone = "/^($sentence)/u"; |
| 213 | + $matches = array(); |
212 | 214 | if( preg_match( $firstone, $text, $matches ) ) { |
213 | 215 | return $matches[1]; |
214 | 216 | } else { |
— | — | @@ -224,6 +226,7 @@ |
225 | 227 | function _extractBadge( $text ) { |
226 | 228 | global $wgContLang; |
227 | 229 | $image = preg_quote( $wgContLang->getNsText( NS_IMAGE ), '#' ); |
| 230 | + $matches = array(); |
228 | 231 | if( preg_match( "#\[\[\s*(?:image|$image)\s*:\s*([^|\]]+)#", $text, $matches ) ) { |
229 | 232 | return trim( $matches[1] ); |
230 | 233 | } else { |
Index: trunk/extensions/LabeledSectionTransclusion/lst.php |
— | — | @@ -239,6 +239,7 @@ |
240 | 240 | |
241 | 241 | $count = 0; |
242 | 242 | $offset = 0; |
| 243 | + $m = array(); |
243 | 244 | while ( preg_match( "/$pat/im", $text, $m, PREG_OFFSET_CAPTURE, $offset ) ) { |
244 | 245 | if ( $m[2][1] > $limit ) |
245 | 246 | break; |
— | — | @@ -301,6 +302,7 @@ |
302 | 303 | return $text; |
303 | 304 | $pat = self::getPattern_( $sec, $to ); |
304 | 305 | |
| 306 | + $m = array(); |
305 | 307 | if ( preg_match_all( $pat, $text, $m, PREG_OFFSET_CAPTURE ) ) { |
306 | 308 | $headings = self::countHeadings_( $text, $m[0][0][1] ); |
307 | 309 | } else { |
Index: trunk/extensions/SpamBlacklist/SpamBlacklist_body.php |
— | — | @@ -40,9 +40,9 @@ |
41 | 41 | $thisHttpRegex = '/^' . preg_quote( $thisHttp, '/' ) . '(?:&.*)?$/'; |
42 | 42 | |
43 | 43 | foreach( $this->files as $fileName ) { |
| 44 | + $matches = array(); |
44 | 45 | if ( preg_match( '/^DB: (\w*) (.*)$/', $fileName, $matches ) ) { |
45 | 46 | if ( $wgDBname == $matches[1] ) { |
46 | | - $sources[] = $matches[2]; |
47 | 47 | if( $matches[2] == $title->getPrefixedDbKey() ) { |
48 | 48 | // Local DB fetch of this page... |
49 | 49 | return true; |
— | — | @@ -122,6 +122,7 @@ |
123 | 123 | # Load lists |
124 | 124 | wfDebugLog( 'SpamBlacklist', "Constructing spam blacklist\n" ); |
125 | 125 | foreach ( $this->files as $fileName ) { |
| 126 | + $matches = array(); |
126 | 127 | if ( preg_match( '/^DB: ([\w-]*) (.*)$/', $fileName, $matches ) ) { |
127 | 128 | $text = $this->getArticleText( $matches[1], $matches[2] ); |
128 | 129 | } elseif ( preg_match( '/^http:\/\//', $fileName ) ) { |
— | — | @@ -228,7 +229,9 @@ |
229 | 230 | $addedLinks = array_diff( $newLinks, $oldLinks ); |
230 | 231 | |
231 | 232 | // We add the edit summary if one exists |
232 | | - if ( !$this->ignoreEditSummary && !empty( $editsummary ) ) $addedLinks[] = $editsummary; |
| 233 | + if ( !$this->ignoreEditSummary && !empty( $editsummary ) ) { |
| 234 | + $addedLinks[] = $editsummary; |
| 235 | + } |
233 | 236 | |
234 | 237 | wfDebugLog( 'SpamBlacklist', "Old URLs: " . implode( ', ', $oldLinks ) ); |
235 | 238 | wfDebugLog( 'SpamBlacklist', "New URLs: " . implode( ', ', $newLinks ) ); |
— | — | @@ -257,6 +260,7 @@ |
258 | 261 | $retVal = false; |
259 | 262 | foreach( $blacklists as $regex ) { |
260 | 263 | wfSuppressWarnings(); |
| 264 | + $matches = array(); |
261 | 265 | $check = preg_match( $regex, $links, $matches ); |
262 | 266 | wfRestoreWarnings(); |
263 | 267 | if( $check ) { |
Index: trunk/extensions/SiteMatrix/SiteMatrixApi.php |
— | — | @@ -89,13 +89,11 @@ |
90 | 90 | } |
91 | 91 | |
92 | 92 | protected function getAllowedParams() { |
93 | | - return array ( |
94 | | - ); |
| 93 | + return array (); |
95 | 94 | } |
96 | 95 | |
97 | 96 | protected function getParamDescription() { |
98 | | - return array ( |
99 | | - ); |
| 97 | + return array (); |
100 | 98 | } |
101 | 99 | |
102 | 100 | protected function getDescription() { |
Index: trunk/extensions/DoubleWiki/DoubleWiki_body.php |
— | — | @@ -36,10 +36,14 @@ |
37 | 37 | * Read the list of matched phrases and add tags to the html output. |
38 | 38 | */ |
39 | 39 | function addMatchingTags ( &$text, $lang ) { |
40 | | - $pattern = "/<div id=\"align-$lang\" style=\"display:none;\">\n<p>([^<]*?)<\/p>\n<\/div>/is"; |
41 | | - if( ! preg_match( $pattern, $text, $m ) ) return ; |
| 40 | + $pattern = "/<div id=\"align-$lang\" style=\"display:none;\">\n<p>([^<]*?)<\/p>\n<\/div>/is"; |
| 41 | + $m = array(); |
| 42 | + if( ! preg_match( $pattern, $text, $m ) ) { |
| 43 | + return; |
| 44 | + } |
42 | 45 | $text = str_replace( $m[1], '', $text ); |
43 | | - $line_pattern = "/\s*([^:\n]*?)\s*:\s*([^:\n]*?)\s*\n/i"; |
| 46 | + $line_pattern = "/\s*([^:\n]*?)\s*:\s*([^:\n]*?)\s*\n/i"; |
| 47 | + $items = array(); |
44 | 48 | preg_match_all( $line_pattern, $m[1], $items, PREG_SET_ORDER ); |
45 | 49 | foreach( $items as $n => $i ) { |
46 | 50 | $text = str_replace( $i[1], "<span id=\"dw-$n\" title=\"{$i[2]}\"/>".$i[1], $text ); |
— | — | @@ -145,6 +149,7 @@ |
146 | 150 | $sub = substr( $right_text, 0, $a); |
147 | 151 | // detect the end of previous paragraph |
148 | 152 | // regexp matches the rightmost delimiter |
| 153 | + $m = array(); |
149 | 154 | if ( preg_match("/(.*)<\/(p|dl)>/is", $sub, $m ) ) { |
150 | 155 | $right_chunk .= $m[0]; |
151 | 156 | $right_text = substr( $right_text, strlen($m[0]) ); |
— | — | @@ -201,6 +206,7 @@ |
202 | 207 | function find_paragraphs( $text ) { |
203 | 208 | $result = Array(); |
204 | 209 | $bits = preg_split( $this->tags, $text ); |
| 210 | + $m = array(); |
205 | 211 | preg_match_all( $this->tags, $text, $m, PREG_SET_ORDER); |
206 | 212 | $counter = 0; |
207 | 213 | $out = ''; |
— | — | @@ -231,6 +237,7 @@ |
232 | 238 | |
233 | 239 | $tag_pattern = "/<span id=\"dw-[^\"]*\" title=\"([^\"]*)\"\/>/i"; |
234 | 240 | $left_slices = preg_split( $tag_pattern, $left_text ); |
| 241 | + $left_tags = array(); |
235 | 242 | preg_match_all( $tag_pattern, $left_text, $left_tags, PREG_PATTERN_ORDER ); |
236 | 243 | $n = count( $left_slices); |
237 | 244 | |
— | — | @@ -240,6 +247,7 @@ |
241 | 248 | */ |
242 | 249 | for ( $i=0 ; $i < $n - 1 ; $i++ ) { |
243 | 250 | $str = $left_slices[$i]; |
| 251 | + $m = array(); |
244 | 252 | if ( preg_match("/(.*)<(p|dl)>/is", $str, $m ) ) { |
245 | 253 | $left_slices[$i] = $m[1]; |
246 | 254 | $left_slices[$i+1] = substr( $str, strlen($m[1]) ) . $left_slices[$i+1]; |
— | — | @@ -254,6 +262,7 @@ |
255 | 263 | $stack = array(); |
256 | 264 | for( $i=0 ; $i < $n ; $i++) { |
257 | 265 | $bits = preg_split( $this->tags, $left_slices[$i] ); |
| 266 | + $m = array(); |
258 | 267 | preg_match_all( $this->tags, $left_slices[$i], $m, PREG_SET_ORDER); |
259 | 268 | $counter = 0; |
260 | 269 | for($k=0 ; $k < count($m) ; $k++) { |
Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler.image.php |
— | — | @@ -105,6 +105,7 @@ |
106 | 106 | |
107 | 107 | wfProfileIn( 'tiffinfo' ); |
108 | 108 | wfDebug( __METHOD__ . ": $cmd\n" ); |
| 109 | + $retval = ''; |
109 | 110 | $dump = wfShellExec( $cmd, $retval ); |
110 | 111 | wfProfileOut( 'tiffinfo' ); |
111 | 112 | |
— | — | @@ -122,6 +123,7 @@ |
123 | 124 | |
124 | 125 | wfProfileIn( 'identify' ); |
125 | 126 | wfDebug( __METHOD__ . ": $cmd\n" ); |
| 127 | + $retval = ''; |
126 | 128 | $dump = wfShellExec( $cmd, $retval ); |
127 | 129 | wfProfileOut( 'identify' ); |
128 | 130 | |
— | — | @@ -153,6 +155,7 @@ |
154 | 156 | |
155 | 157 | wfProfileIn( 'exiv2' ); |
156 | 158 | wfDebug( __METHOD__ . ": $cmd\n" ); |
| 159 | + $retval = ''; |
157 | 160 | $dump = wfShellExec( $cmd, $retval ); |
158 | 161 | wfProfileOut( 'exiv2' ); |
159 | 162 | |
— | — | @@ -225,6 +228,8 @@ |
226 | 229 | |
227 | 230 | if ( $error ) continue; |
228 | 231 | |
| 232 | + $m = array(); |
| 233 | + |
229 | 234 | if ( preg_match('/^TIFF Directory at offset 0x[a-f0-9]+ \((\d+)\)/', $row, $m) ) { |
230 | 235 | # new IFD starting, flush previous page |
231 | 236 | |
Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | // I ain't kidding... RecursiveIteratorIterator. |
73 | 73 | foreach( new RecursiveIteratorIterator( $dirs ) as $pathname => $item ) { |
74 | 74 | $filename = basename( $pathname ); |
75 | | - |
| 75 | + $matches = array(); |
76 | 76 | if( preg_match( '/^(.*)\.i18n\.php$/', $filename, $matches ) ) { |
77 | 77 | $group = $matches[1]; |
78 | 78 | $extFiles[$group] = $pathname; |