From: umherirrender Date: Sat, 16 Nov 2013 17:17:36 +0000 (+0100) Subject: Avoid empty batch in ListredirectsPage::preprocessResults X-Git-Tag: 1.31.0-rc.0~18094^2 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=81293cea063b367fdc2767c9157e0d41e4d495b5;p=lhc%2Fweb%2Fwiklou.git Avoid empty batch in ListredirectsPage::preprocessResults Change-Id: Iaf371cdb1c0628a42996537d966165a0d7f92ad7 --- diff --git a/includes/specials/SpecialListredirects.php b/includes/specials/SpecialListredirects.php index 2c8792ff6f..de05be41f8 100644 --- a/includes/specials/SpecialListredirects.php +++ b/includes/specials/SpecialListredirects.php @@ -76,20 +76,19 @@ class ListredirectsPage extends QueryPage { * @param ResultWrapper $res */ function preprocessResults( $db, $res ) { - $batch = new LinkBatch; + if ( !$res->numRows() ) { + return; + } + $batch = new LinkBatch; foreach ( $res as $row ) { $batch->add( $row->namespace, $row->title ); $batch->addObj( $this->getRedirectTarget( $row ) ); } - $batch->execute(); // Back to start for display - if ( $res->numRows() > 0 ) { - // If there are no rows we get an error seeking. - $db->dataSeek( $res, 0 ); - } + $res->seek( 0 ); } protected function getRedirectTarget( $row ) {