Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -264,7 +264,7 @@ |
265 | 265 | */ |
266 | 266 | public static function getPatrolLevel() { |
267 | 267 | global $wgFlaggedRevsPatrolLevel; |
268 | | - return intval($wgFlaggedRevsPatrolLevel); |
| 268 | + return (int)$wgFlaggedRevsPatrolLevel; |
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
— | — | @@ -737,8 +737,9 @@ |
738 | 738 | public static function updateStableVersion( $article, $rev, $latest = NULL ) { |
739 | 739 | if( !$article->getId() ) |
740 | 740 | return true; // no bogus entries |
741 | | - # Get the latest revision ID |
742 | | - $lastID = $latest ? $latest : $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE); |
| 741 | + # Get the latest revision ID if not set |
| 742 | + if( !$latest ) |
| 743 | + $latest = $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE); |
743 | 744 | # Get the highest quality revision (not necessarily this one) |
744 | 745 | $dbw = wfGetDB( DB_MASTER ); |
745 | 746 | $maxQuality = $dbw->selectField( array('flaggedrevs','revision'), |
— | — | @@ -753,7 +754,7 @@ |
754 | 755 | ); |
755 | 756 | # Get the timestamp of the edit after the stable version (if any) |
756 | 757 | $revId = $rev->getId(); |
757 | | - if( $lastID != $revId ) { |
| 758 | + if( $latest != $revId ) { |
758 | 759 | # Get the latest revision ID |
759 | 760 | $timestamp = $rev->getTimestamp(); |
760 | 761 | $nextTimestamp = $dbw->selectField( 'revision', |
— | — | @@ -770,7 +771,7 @@ |
771 | 772 | $dbw->replace( 'flaggedpages', |
772 | 773 | array( 'fp_page_id' ), |
773 | 774 | array( 'fp_stable' => $revId, |
774 | | - 'fp_reviewed' => ($lastID == $revId) ? 1 : 0, |
| 775 | + 'fp_reviewed' => ($latest == $revId) ? 1 : 0, |
775 | 776 | 'fp_quality' => ($maxQuality === false) ? null : $maxQuality, |
776 | 777 | 'fp_page_id' => $article->getId(), |
777 | 778 | 'fp_pending_since' => $nextTimestamp ? $dbw->timestamp($nextTimestamp) : null ), |
— | — | @@ -791,8 +792,9 @@ |
792 | 793 | $level = self::pristineVersions() ? FR_PRISTINE : FR_QUALITY; |
793 | 794 | if( !self::qualityVersions() ) |
794 | 795 | $level = FR_SIGHTED; |
795 | | - # Get the latest revision ID |
796 | | - $lastID = $latest ? $latest : $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE); |
| 796 | + # Get the latest revision ID if not set |
| 797 | + if( !$latest ) |
| 798 | + $latest = $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE); |
797 | 799 | $pageId = $article->getId(); |
798 | 800 | # Update pending times for each level |
799 | 801 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -813,7 +815,7 @@ |
814 | 816 | if( $row ) { |
815 | 817 | $id = intval( $row->fr_rev_id ); |
816 | 818 | # Get the timestamp of the edit after this version (if any) |
817 | | - if( $lastID != $id ) { |
| 819 | + if( $latest != $id ) { |
818 | 820 | $nextTimestamp = $dbw->selectField( 'revision', |
819 | 821 | 'rev_timestamp', |
820 | 822 | array( 'rev_page' => $pageId, |