aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/SpecialAllpages.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php
index 70f52eaaf098..1202878601b0 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 );
}