Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.hooks.php |
— | — | @@ -520,6 +520,11 @@ |
521 | 521 | if ( !$user || $rev !== null ) { |
522 | 522 | return true; |
523 | 523 | } |
| 524 | + # Rollback/undo or box checked |
| 525 | + $reviewEdit = $wgRequest->getCheck( 'wpReviewEdit' ); |
| 526 | + if ( !$baseId && !$reviewEdit ) { |
| 527 | + return true; // short-circuit |
| 528 | + } |
524 | 529 | $fa = FlaggedPage::getArticleInstance( $article ); |
525 | 530 | $fa->loadFromDB( FR_MASTER ); |
526 | 531 | if ( !$fa->isReviewable() ) { |
— | — | @@ -534,9 +539,12 @@ |
535 | 540 | $flags = null; |
536 | 541 | # Is this a rollback/undo that didn't change anything? |
537 | 542 | if ( $baseId > 0 ) { |
538 | | - $frev = FlaggedRevision::newFromTitle( $title, $baseId ); |
| 543 | + $frev = FlaggedRevision::newFromTitle( $title, $baseId ); // base rev of null edit |
| 544 | + $pRev = Revision::newFromId( $rev->getParentId() ); // current rev parent |
| 545 | + $revIsNull = ( $pRev && $pRev->getTextId() == $rev->getTextId() ); |
539 | 546 | # Was the edit that we tried to revert to reviewed? |
540 | | - if ( $frev ) { |
| 547 | + # We avoid auto-reviewing null edits to avoid confusion (bug 28476). |
| 548 | + if ( $frev && !$revIsNull ) { |
541 | 549 | # Review this revision of the page... |
542 | 550 | $ok = FlaggedRevs::autoReviewEdit( $article, $user, $rev, $flags ); |
543 | 551 | if ( $ok ) { |
— | — | @@ -549,10 +557,7 @@ |
550 | 558 | # Get edit timestamp, it must exist. |
551 | 559 | $editTimestamp = $wgRequest->getVal( 'wpEdittime' ); |
552 | 560 | # Is the page checked off to be reviewed? |
553 | | - if ( $editTimestamp |
554 | | - && $wgRequest->getCheck( 'wpReviewEdit' ) |
555 | | - && $title->userCan( 'review' ) ) |
556 | | - { |
| 561 | + if ( $editTimestamp && $reviewEdit && $title->userCan( 'review' ) ) { |
557 | 562 | # Check wpEdittime against current revision's time. |
558 | 563 | # If an edit was auto-merged in between, review only up to what |
559 | 564 | # was the current rev when this user started editing the page. |