Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -765,20 +765,21 @@ |
766 | 766 | __METHOD__, |
767 | 767 | array( 'ORDER BY' => 'fr_quality DESC', 'LIMIT' => 1 ) |
768 | 768 | ); |
769 | | - # Get the timestamp of the edit after the stable version (if any) |
| 769 | + # Get the timestamp of the first edit after the stable version (if any)... |
| 770 | + $nextTimestamp = null; |
770 | 771 | $revId = $rev->getId(); |
771 | 772 | if ( $latest != $revId ) { |
772 | | - # Get the latest revision ID |
773 | 773 | $timestamp = $rev->getTimestamp(); |
774 | | - $nextTimestamp = $dbw->selectField( 'revision', |
| 774 | + $nextEditTS = $dbw->selectField( 'revision', |
775 | 775 | 'rev_timestamp', |
776 | 776 | array( 'rev_page' => $article->getId(), |
777 | 777 | "rev_timestamp > " . $dbw->addQuotes( $dbw->timestamp( $timestamp ) ) ), |
778 | 778 | __METHOD__, |
779 | 779 | array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1 ) |
780 | 780 | ); |
781 | | - } else { |
782 | | - $nextTimestamp = null; |
| 781 | + if ( $nextEditTS ) { // sanity check |
| 782 | + $nextTimestamp = $nextEditTS; |
| 783 | + } |
783 | 784 | } |
784 | 785 | # Alter table metadata |
785 | 786 | $dbw->replace( 'flaggedpages', |
— | — | @@ -788,7 +789,7 @@ |
789 | 790 | 'fp_reviewed' => ( $latest == $revId ) ? 1 : 0, |
790 | 791 | 'fp_quality' => ( $maxQuality === false ) ? null : $maxQuality, |
791 | 792 | 'fp_page_id' => $article->getId(), |
792 | | - 'fp_pending_since' => $nextTimestamp ? $dbw->timestamp( $nextTimestamp ) : null |
| 793 | + 'fp_pending_since' => $dbw->timestampOrNull( $nextTimestamp ) |
793 | 794 | ), |
794 | 795 | __METHOD__ |
795 | 796 | ); |