Index: trunk/phase3/includes/specials/SpecialPrefixindex.php |
— | — | @@ -47,18 +47,18 @@ |
48 | 48 | # GET values |
49 | 49 | $from = $wgRequest->getVal( 'from', '' ); |
50 | 50 | $prefix = $wgRequest->getVal( 'prefix', '' ); |
51 | | - $namespace = $wgRequest->getInt( 'namespace' ); |
| 51 | + $ns = $wgRequest->getIntOrNull( 'namespace' ); |
| 52 | + $namespace = (int)$ns; // if no namespace given, use 0 (NS_MAIN). |
| 53 | + |
52 | 54 | $namespaces = $wgContLang->getNamespaces(); |
53 | | - |
54 | | - $wgOut->setPagetitle( ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces ) ) ) |
55 | | - ? wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) |
56 | | - : wfMsg( 'prefixindex' ) |
| 55 | + $wgOut->setPagetitle( |
| 56 | + ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces ) ) ) |
| 57 | + ? wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) |
| 58 | + : wfMsg( 'prefixindex' ) |
57 | 59 | ); |
58 | 60 | |
59 | 61 | $showme = ''; |
60 | | - if ( $this->including() && $par == '' ) { |
61 | | - // Bug 27864: if transcluded, show all pages instead of the form |
62 | | - } elseif( isset( $par ) ) { |
| 62 | + if( isset( $par ) ) { |
63 | 63 | $showme = $par; |
64 | 64 | } elseif( $prefix != '' ) { |
65 | 65 | $showme = $prefix; |
— | — | @@ -66,7 +66,9 @@ |
67 | 67 | // For back-compat with Special:Allpages |
68 | 68 | $showme = $from; |
69 | 69 | } |
70 | | - if ( $showme != '' || $namespace ) { |
| 70 | + |
| 71 | + // Bug 27864: if transcluded, show all pages instead of the form. |
| 72 | + if ( $this->including() || $showme != '' || $ns !== null ) { |
71 | 73 | $this->showPrefixChunk( $namespace, $showme, $from ); |
72 | 74 | } else { |
73 | 75 | $wgOut->addHTML( $this->namespacePrefixForm( $namespace, null ) ); |