From f12f73ac699750cf5bc0ff670d2dbe3f59a7e63e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 25 Apr 2005 15:35:02 +0000 Subject: [PATCH] If misestimated number of sections, don't add a bogus line. Triggered by funny 'invert' circumstances at least --- includes/SpecialAllpages.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 70f52eaaf0..1202878601 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -135,10 +135,11 @@ function indexShowToplevel ( $namespace = NS_MAIN, $invert ) { $limit = ( $i == $offset || $i == $stopat ) ? 1 : 2; $sql = "SELECT page_title $fromwhere $order_str " . $dbr->limitResult ( $limit, $from ); $res = $dbr->query( $sql, $fname ); - $s = $dbr->fetchObject( $res ); - array_push ( $lines, $s->page_title ); if ( $s = $dbr->fetchObject( $res ) ) { array_push ( $lines, $s->page_title ); + if ( $s = $dbr->fetchObject( $res ) ) { + array_push ( $lines, $s->page_title ); + } } $dbr->freeResult( $res ); } -- 2.20.1