r28159 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28158‎ | r28159 | r28160 >
Date:22:14, 4 December 2007
Author:amidaniel
Status:old
Tags:
Comment:
Woops, fix bug with last commit when the number of rows <= 2.
Modified paths:
  • /trunk/phase3/includes/SpecialUndelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUndelete.php
@@ -862,13 +862,17 @@
863863
864864 $hasMore = false;
865865 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;
869873
870874 $titleObj = SpecialPage::getTitleFor ( 'Undelete' );
871875 $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" );
873877
874878 $wgOut->addHTML ( wfMsg ( 'undelete-more-revs', $tmpLimit - 1, $tmplink ) );
875879 $hasMore = true;

Status & tagging log