r68607 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68606‎ | r68607 | r68608 >
Date:19:10, 26 June 2010
Author:aaron
Status:ok
Tags:
Comment:
Minor cleanup for updateStableVersion()
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -765,20 +765,21 @@
766766 __METHOD__,
767767 array( 'ORDER BY' => 'fr_quality DESC', 'LIMIT' => 1 )
768768 );
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;
770771 $revId = $rev->getId();
771772 if ( $latest != $revId ) {
772 - # Get the latest revision ID
773773 $timestamp = $rev->getTimestamp();
774 - $nextTimestamp = $dbw->selectField( 'revision',
 774+ $nextEditTS = $dbw->selectField( 'revision',
775775 'rev_timestamp',
776776 array( 'rev_page' => $article->getId(),
777777 "rev_timestamp > " . $dbw->addQuotes( $dbw->timestamp( $timestamp ) ) ),
778778 __METHOD__,
779779 array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1 )
780780 );
781 - } else {
782 - $nextTimestamp = null;
 781+ if ( $nextEditTS ) { // sanity check
 782+ $nextTimestamp = $nextEditTS;
 783+ }
783784 }
784785 # Alter table metadata
785786 $dbw->replace( 'flaggedpages',
@@ -788,7 +789,7 @@
789790 'fp_reviewed' => ( $latest == $revId ) ? 1 : 0,
790791 'fp_quality' => ( $maxQuality === false ) ? null : $maxQuality,
791792 'fp_page_id' => $article->getId(),
792 - 'fp_pending_since' => $nextTimestamp ? $dbw->timestamp( $nextTimestamp ) : null
 793+ 'fp_pending_since' => $dbw->timestampOrNull( $nextTimestamp )
793794 ),
794795 __METHOD__
795796 );

Status & tagging log