Index: trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php |
— | — | @@ -405,11 +405,15 @@ |
406 | 406 | $oldSv = FlaggedRevision::newFromStable( $this->page, FR_MASTER ); |
407 | 407 | |
408 | 408 | # Is this rev already flagged? (re-review) |
409 | | - if ( $oldSv && $rev->getId() == $oldSv->getRevId() ) { |
410 | | - $oldfrev = $oldSv; // save a query |
411 | | - } else { |
412 | | - $oldfrev = FlaggedRevision::newFromTitle( $this->page, $rev->getId(), FR_MASTER ); |
| 409 | + $oldFrev = null; |
| 410 | + if ( $oldSv ) { // stable rev exists |
| 411 | + if ( $rev->getId() == $oldSv->getRevId() ) { |
| 412 | + $oldFrev = $oldSv; // save a query |
| 413 | + } else { |
| 414 | + $oldFrev = FlaggedRevision::newFromTitle( $this->page, $rev->getId(), FR_MASTER ); |
| 415 | + } |
413 | 416 | } |
| 417 | + |
414 | 418 | # Be loose on templates that includes other files/templates dynamically. |
415 | 419 | # Strict checking breaks randomized images/metatemplates...(bug 14580) |
416 | 420 | global $wgUseCurrentTemplates, $wgUseCurrentImages; |
— | — | @@ -431,15 +435,15 @@ |
432 | 436 | FlaggedRevs::clearIncludeVersionCache( $rev->getId() ); |
433 | 437 | |
434 | 438 | # Is this a duplicate review? |
435 | | - if ( $oldfrev ) { |
436 | | - $fileSha1 = $fileData ? |
437 | | - $fileData['sha1'] : null; // stable upload version for file pages |
| 439 | + if ( $oldFrev ) { |
| 440 | + // stable upload version for file pages |
| 441 | + $fileSha1 = $fileData ? $fileData['sha1'] : null; |
438 | 442 | $synced = ( |
439 | | - $oldfrev->getTags() == $flags && // tags => quality |
440 | | - $oldfrev->getFileSha1() == $fileSha1 && |
441 | | - $oldfrev->getComment() == $this->notes && |
442 | | - $oldfrev->getTemplateVersions() == $tmpParams && |
443 | | - $oldfrev->getFileVersions() == $imgParams |
| 443 | + $oldFrev->getTags() == $flags && // tags => quality |
| 444 | + $oldFrev->getFileSha1() == $fileSha1 && |
| 445 | + $oldFrev->getComment() == $this->notes && |
| 446 | + $oldFrev->getTemplateVersions() == $tmpParams && |
| 447 | + $oldFrev->getFileVersions() == $imgParams |
444 | 448 | ); |
445 | 449 | # Don't review if the same |
446 | 450 | if ( $synced ) { |