Index: trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php |
— | — | @@ -991,7 +991,7 @@ |
992 | 992 | * UI things back up, since RevisionReview expects either true |
993 | 993 | * or a string message key |
994 | 994 | */ |
995 | | - private function rejectConfirmationForm( Revision $oldRev, $newRev ) { |
| 995 | + private function rejectConfirmationForm( Revision $oldRev, Revision $newRev ) { |
996 | 996 | global $wgOut, $wgLang; |
997 | 997 | $thisPage = SpecialPage::getTitleFor( 'RevisionReview' ); |
998 | 998 | |
— | — | @@ -1000,7 +1000,8 @@ |
1001 | 1001 | $dbr = wfGetDB( DB_SLAVE ); |
1002 | 1002 | $oldid = $dbr->addQuotes( $oldRev->getId() ); |
1003 | 1003 | $newid = $dbr->addQuotes( $newRev->getId() ); |
1004 | | - $res = $dbr->select( 'revision', array( 'rev_id', 'rev_user_text' ), |
| 1004 | + $res = $dbr->select( 'revision', |
| 1005 | + array( 'rev_id', 'rev_user_text' ), |
1005 | 1006 | array( |
1006 | 1007 | 'rev_id > ' . $oldid, |
1007 | 1008 | 'rev_id <= ' . $newid, |
— | — | @@ -1008,13 +1009,15 @@ |
1009 | 1010 | ), |
1010 | 1011 | __METHOD__ |
1011 | 1012 | ); |
| 1013 | + if ( !$dbr->numRows( $res ) ) { // sanity check |
| 1014 | + $wgOut->redirect( $this->getPage()->getFullUrl() ); |
| 1015 | + return; |
| 1016 | + } |
1012 | 1017 | |
1013 | 1018 | $rejectIds = array(); |
1014 | | - if( $res ) { |
1015 | | - foreach( $res as $r ) { |
1016 | | - $rejectIds[$r->rev_id] = |
1017 | | - "[[User:{$r->rev_user_text}|{$r->rev_user_text}]]"; |
1018 | | - } |
| 1019 | + foreach( $res as $r ) { |
| 1020 | + $rejectIds[$r->rev_id] = |
| 1021 | + "[[User:{$r->rev_user_text}|{$r->rev_user_text}]]"; |
1019 | 1022 | } |
1020 | 1023 | |
1021 | 1024 | // List of revisions being undone... |