http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90724

Revision: 90724
Author:   aaron
Date:     2011-06-24 19:22:50 +0000 (Fri, 24 Jun 2011)
Log Message:
-----------
* 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.

Modified Paths:
--------------
    trunk/phase3/includes/specials/SpecialPrefixindex.php

Modified: trunk/phase3/includes/specials/SpecialPrefixindex.php
===================================================================
--- trunk/phase3/includes/specials/SpecialPrefixindex.php       2011-06-24 
18:12:36 UTC (rev 90723)
+++ trunk/phase3/includes/specials/SpecialPrefixindex.php       2011-06-24 
19:22:50 UTC (rev 90724)
@@ -47,18 +47,18 @@
                # GET values
                $from = $wgRequest->getVal( 'from', '' );
                $prefix = $wgRequest->getVal( 'prefix', '' );
-               $namespace = $wgRequest->getInt( 'namespace' );
+               $ns = $wgRequest->getIntOrNull( 'namespace' );
+               $namespace = (int)$ns; // if no namespace given, use 0 
(NS_MAIN).
+
                $namespaces = $wgContLang->getNamespaces();
-
-               $wgOut->setPagetitle( ( $namespace > 0 && in_array( $namespace, 
array_keys( $namespaces ) ) )
-                       ? wfMsg( 'allinnamespace', str_replace( '_', ' ', 
$namespaces[$namespace] ) )
-                       : wfMsg( 'prefixindex' )
+               $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 @@
                        // 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 ) );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to