Index: trunk/phase3/includes/SpecialUndelete.php |
— | — | @@ -862,13 +862,17 @@ |
863 | 863 | |
864 | 864 | $hasMore = false; |
865 | 865 | if ( $revisions && $revisions->numRows() >= $tmpLimit ) { |
866 | | - $revisions->seek ( $revisions->numRows() - 2 ); |
867 | | - $tmp = $revisions->fetchObject(); |
868 | | - $revisions->rewind ( ); |
| 866 | + if ( $revisions->numRows() >= 2 ) { |
| 867 | + $revisions->seek ( $revisions->numRows() - 2 ); |
| 868 | + $tmp = $revisions->fetchObject(); |
| 869 | + $revisions->rewind ( ); |
| 870 | + $offset = $tmp->ar_timestamp; |
| 871 | + } else |
| 872 | + $offset = 0; |
869 | 873 | |
870 | 874 | $titleObj = SpecialPage::getTitleFor ( 'Undelete' ); |
871 | 875 | $tmplink = $sk->makeKnownLinkObj ( $titleObj, wfMsg( 'undelete-next-revs', 5000 ), |
872 | | - "target={$this->mTarget}&limit=5000&offset={$tmp->ar_timestamp}" ); |
| 876 | + "target={$this->mTarget}&limit=5000&offset=$offset" ); |
873 | 877 | |
874 | 878 | $wgOut->addHTML ( wfMsg ( 'undelete-more-revs', $tmpLimit - 1, $tmplink ) ); |
875 | 879 | $hasMore = true; |