Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -439,6 +439,7 @@ |
440 | 440 | */ |
441 | 441 | public function getAffectedRevs() { |
442 | 442 | $affectedRevs = array(); |
| 443 | + $m = array(); |
443 | 444 | if ( preg_match_all( '/\br(\d{2,})\b/', $this->mMessage, $m ) ) { |
444 | 445 | foreach ( $m[1] as $rev ) { |
445 | 446 | $affectedRev = intval( $rev ); |
— | — | @@ -456,8 +457,11 @@ |
457 | 458 | * @return array |
458 | 459 | */ |
459 | 460 | public function getAffectedBugRevs() { |
| 461 | + $dbw = wfGetDB( DB_MASTER ); |
| 462 | + |
460 | 463 | // Update bug references table... |
461 | 464 | $affectedBugs = array(); |
| 465 | + $m = array(); |
462 | 466 | if ( preg_match_all( '/\bbug (\d+)\b/', $this->mMessage, $m ) ) { |
463 | 467 | $data = array(); |
464 | 468 | foreach ( $m[1] as $bug ) { |
— | — | @@ -468,7 +472,6 @@ |
469 | 473 | ); |
470 | 474 | $affectedBugs[] = intval( $bug ); |
471 | 475 | } |
472 | | - $dbw = wfGetDB( DB_MASTER ); |
473 | 476 | $dbw->insert( 'code_bugs', $data, __METHOD__, array( 'IGNORE' ) ); |
474 | 477 | } |
475 | 478 | |
Index: trunk/extensions/CodeReview/backend/CodeRepository.php |
— | — | @@ -284,8 +284,7 @@ |
285 | 285 | $paths = $revision->getModifiedPaths(); |
286 | 286 | if ( !$paths->numRows() ) { |
287 | 287 | $data = DIFFRESULT_NothingToCompare; |
288 | | - } |
289 | | - elseif ( $wgCodeReviewMaxDiffPaths > 0 && $paths->numRows() > $wgCodeReviewMaxDiffPaths ) { |
| 288 | + } elseif ( $wgCodeReviewMaxDiffPaths > 0 && $paths->numRows() > $wgCodeReviewMaxDiffPaths ) { |
290 | 289 | $data = DIFFRESULT_TooManyPaths; |
291 | 290 | } |
292 | 291 | } |
Index: trunk/extensions/CodeReview/backend/Subversion.php |
— | — | @@ -204,6 +204,7 @@ |
205 | 205 | $i = 0; |
206 | 206 | foreach ( $formats as $key => $regex ) { |
207 | 207 | $text = $bits[$i++]; |
| 208 | + $matches = array(); |
208 | 209 | if ( preg_match( $regex, $text, $matches ) ) { |
209 | 210 | $data[$key] = $matches[1]; |
210 | 211 | } else { |
— | — | @@ -231,6 +232,7 @@ |
232 | 233 | // Out of paths. Move on to the message... |
233 | 234 | $state = 'msg'; |
234 | 235 | } else { |
| 236 | + $matches = array(); |
235 | 237 | if ( preg_match( '/^ (.) (.*)$/', $line, $matches ) ) { |
236 | 238 | $data['paths'][] = array( |
237 | 239 | 'action' => $matches[1], |