Index: trunk/extensions/FlaggedRevs/dataclasses/FRInclusionManager.php |
— | — | @@ -170,8 +170,7 @@ |
171 | 171 | $id = $this->stableVersions['templates'][$namespace][$dbKey]; |
172 | 172 | } |
173 | 173 | if ( $id === null ) { // cache miss |
174 | | - $srev = FlaggedRevision::newFromStable( $title ); |
175 | | - $id = $srev ? $srev->getRevId() : 0; |
| 174 | + $id = FlaggedRevision::getStableRevId( $title ); |
176 | 175 | } |
177 | 176 | $this->stableVersions['templates'][$namespace][$dbKey] = $id; // cache |
178 | 177 | return $id; |
Index: trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php |
— | — | @@ -296,11 +296,16 @@ |
297 | 297 | } elseif ( !$newRev || $newRev->isDeleted( Revision::DELETED_TEXT ) ) { |
298 | 298 | return 'review_bad_oldid'; |
299 | 299 | } |
| 300 | + # Check that the revs are in order |
| 301 | + if ( $oldRev->getTimestamp() > $newRev->getTimestamp() ) { |
| 302 | + return 'review_cannot_undo'; |
| 303 | + } |
| 304 | + # Make sure we are only rejecting pending changes |
300 | 305 | $srev = FlaggedRevision::newFromStable( $this->page, FR_MASTER ); |
301 | | - if ( $srev && $srev->getRevId() > $oldRev->getId() ) { |
| 306 | + if ( $srev && $oldRev->getTimestamp() < $srev->getRevTimestamp() ) { |
302 | 307 | return 'review_cannot_reject'; // not really a use case |
303 | 308 | } |
304 | | - $article = new Article( $this->page ); |
| 309 | + $article = new WikiPage( $this->page ); |
305 | 310 | # Get text with changes after $oldRev up to and including $newRev removed |
306 | 311 | $new_text = $article->getUndoText( $newRev, $oldRev ); |
307 | 312 | if ( $new_text === false ) { |
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php |
— | — | @@ -548,9 +548,9 @@ |
549 | 549 | // diff=review param (bug 16923) |
550 | 550 | public static function checkDiffUrl( $titleObj, &$mOldid, &$mNewid, $old, $new ) { |
551 | 551 | if ( $new === 'review' && isset( $titleObj ) ) { |
552 | | - $frev = FlaggedRevision::newFromStable( $titleObj ); |
553 | | - if ( $frev ) { |
554 | | - $mOldid = $frev->getRevId(); // stable |
| 552 | + $sRevId = FlaggedRevision::getStableRevId( $titleObj ); |
| 553 | + if ( $sRevId ) { |
| 554 | + $mOldid = $sRevId; // stable |
555 | 555 | $mNewid = 0; // cur |
556 | 556 | } |
557 | 557 | } |