From: Daniel Cannon Date: Tue, 4 Dec 2007 22:14:25 +0000 (+0000) Subject: Woops, fix bug with last commit when the number of rows <= 2. X-Git-Tag: 1.31.0-rc.0~50544 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=a17a1935659d66837bc6b45fc78faa4900d7c2be;p=lhc%2Fweb%2Fwiklou.git Woops, fix bug with last commit when the number of rows <= 2. --- diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index a49bd7176d..2f88bda2ed 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -862,13 +862,17 @@ class UndeleteForm { $hasMore = false; if ( $revisions && $revisions->numRows() >= $tmpLimit ) { - $revisions->seek ( $revisions->numRows() - 2 ); - $tmp = $revisions->fetchObject(); - $revisions->rewind ( ); + if ( $revisions->numRows() >= 2 ) { + $revisions->seek ( $revisions->numRows() - 2 ); + $tmp = $revisions->fetchObject(); + $revisions->rewind ( ); + $offset = $tmp->ar_timestamp; + } else + $offset = 0; $titleObj = SpecialPage::getTitleFor ( 'Undelete' ); $tmplink = $sk->makeKnownLinkObj ( $titleObj, wfMsg( 'undelete-next-revs', 5000 ), - "target={$this->mTarget}&limit=5000&offset={$tmp->ar_timestamp}" ); + "target={$this->mTarget}&limit=5000&offset=$offset" ); $wgOut->addHTML ( wfMsg ( 'undelete-more-revs', $tmpLimit - 1, $tmplink ) ); $hasMore = true;