r90724 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90723‎ | r90724 | r90725 >
Date:19:22, 24 June 2011
Author:aaron
Status:ok
Tags:
Comment:
* 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) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialPrefixindex.php
@@ -47,18 +47,18 @@
4848 # GET values
4949 $from = $wgRequest->getVal( 'from', '' );
5050 $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+
5254 $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' )
5759 );
5860
5961 $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 ) ) {
6363 $showme = $par;
6464 } elseif( $prefix != '' ) {
6565 $showme = $prefix;
@@ -66,7 +66,9 @@
6767 // For back-compat with Special:Allpages
6868 $showme = $from;
6969 }
70 - if ( $showme != '' || $namespace ) {
 70+
 71+ // Bug 27864: if transcluded, show all pages instead of the form.
 72+ if ( $this->including() || $showme != '' || $ns !== null ) {
7173 $this->showPrefixChunk( $namespace, $showme, $from );
7274 } else {
7375 $wgOut->addHTML( $this->namespacePrefixForm( $namespace, null ) );

Sign-offs

UserFlagDate
Aaron Schulztested19:23, 24 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88084(bug 27864) Transcluding {{Special:Prefix}} with empty prefix now lists all p...btongminh14:15, 14 May 2011
r90692Minor code cleanupsaaron07:08, 24 June 2011

Status & tagging log