From: Aaron Schulz Date: Fri, 24 Jun 2011 19:22:50 +0000 (+0000) Subject: * More cleanups for r88084 (and fixed r90692). X-Git-Tag: 1.31.0-rc.0~29309 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=c5bb3061cd1f2d143f42caa60e6c26ef7dfe2576;p=lhc%2Fweb%2Fwiklou.git * More cleanups for r88084 (and fixed r90692). * Fixed older problem with PrefixIndex not listing anything if all you give is namespace=NS_MAIN whereas any other NS worked fine. --- diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 1421a61777..a9015b10cf 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -47,18 +47,18 @@ class SpecialPrefixindex extends SpecialAllpages { # GET values $from = $wgRequest->getVal( 'from', '' ); $prefix = $wgRequest->getVal( 'prefix', '' ); - $namespace = $wgRequest->getInt( 'namespace' ); - $namespaces = $wgContLang->getNamespaces(); + $ns = $wgRequest->getIntOrNull( 'namespace' ); + $namespace = (int)$ns; // if no namespace given, use 0 (NS_MAIN). - $wgOut->setPagetitle( ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces ) ) ) - ? wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) - : wfMsg( 'prefixindex' ) + $namespaces = $wgContLang->getNamespaces(); + $wgOut->setPagetitle( + ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces ) ) ) + ? wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) + : wfMsg( 'prefixindex' ) ); $showme = ''; - if ( $this->including() && $par == '' ) { - // Bug 27864: if transcluded, show all pages instead of the form - } elseif( isset( $par ) ) { + if( isset( $par ) ) { $showme = $par; } elseif( $prefix != '' ) { $showme = $prefix; @@ -66,7 +66,9 @@ class SpecialPrefixindex extends SpecialAllpages { // For back-compat with Special:Allpages $showme = $from; } - if ( $showme != '' || $namespace ) { + + // Bug 27864: if transcluded, show all pages instead of the form. + if ( $this->including() || $showme != '' || $ns !== null ) { $this->showPrefixChunk( $namespace, $showme, $from ); } else { $wgOut->addHTML( $this->namespacePrefixForm( $namespace, null ) );