From e49e1db55f6681e762c6beaf836eed0c6b27303b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 17 Aug 2008 00:57:31 +0000 Subject: [PATCH] check if $lines is empty --- includes/specials/SpecialAllpages.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 13a6ab0196..8e4eb00b02 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -188,7 +188,11 @@ function showToplevel( $namespace = NS_MAIN, $from = '', $to = '', $including = // If there are only two or less sections, don't even display them. // Instead, display the first section directly. if( count( $lines ) <= 2 ) { - $this->showChunk( $namespace, $lines[0], $lines[count($lines)-1], $including ); + if( !empty($lines) ) { + $this->showChunk( $namespace, $lines[0], $lines[count($lines)-1], $including ); + } else { + $wgOut->addHtml( $this->namespaceForm( $namespace, $from, $to ) ); + } return; } -- 2.20.1