r39516 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39515‎ | r39516 | r39517 >
Date:00:57, 17 August 2008
Author:aaron
Status:old
Tags:
Comment:
check if $lines is empty
Modified paths:
  • /trunk/phase3/includes/specials/SpecialAllpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialAllpages.php
@@ -188,7 +188,11 @@
189189 // If there are only two or less sections, don't even display them.
190190 // Instead, display the first section directly.
191191 if( count( $lines ) <= 2 ) {
192 - $this->showChunk( $namespace, $lines[0], $lines[count($lines)-1], $including );
 192+ if( !empty($lines) ) {
 193+ $this->showChunk( $namespace, $lines[0], $lines[count($lines)-1], $including );
 194+ } else {
 195+ $wgOut->addHtml( $this->namespaceForm( $namespace, $from, $to ) );
 196+ }
193197 return;
194198 }
195199

Status & tagging log