From: Brion Vibber Date: Mon, 25 Apr 2005 15:35:02 +0000 (+0000) Subject: If misestimated number of sections, don't add a bogus line. X-Git-Tag: 1.5.0alpha1~132 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=f12f73ac699750cf5bc0ff670d2dbe3f59a7e63e;p=lhc%2Fweb%2Fwiklou.git If misestimated number of sections, don't add a bogus line. Triggered by funny 'invert' circumstances at least --- 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 ); }