From: Brion Vibber Date: Wed, 30 Nov 2011 22:38:39 +0000 (+0000) Subject: * (bug 16434) Fix paging on Special:Prefixindex when prefix is empty (whole namespace). X-Git-Tag: 1.31.0-rc.0~26207 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=7824e5eca6e91b12e3b46a052e6518ece04835b5;p=lhc%2Fweb%2Fwiklou.git * (bug 16434) Fix paging on Special:Prefixindex when prefix is empty (whole namespace). Tweaked input handling to make sure the 'from' => 'prefix' mapping doesn't happen if we have passed a namespace parameter (indicating we're working within the form). Tweaked the form paging links to include the NS even if it's 0. :) Originally wanted to just check for presence of 'prefix' however wfArrayToCgi() strips empty values, and I'm not comfortable tweaking that without a lot more testing. --- diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 43b7d27900..325236585f 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -65,8 +65,9 @@ class SpecialPrefixindex extends SpecialAllpages { $showme = $par; } elseif( $prefix != '' ) { $showme = $prefix; - } elseif( $from != '' ) { + } elseif( $from != '' && $ns === null ) { // For back-compat with Special:Allpages + // Don't do this if namespace is passed, so paging works when doing NS views. $showme = $from; } @@ -216,10 +217,11 @@ class SpecialPrefixindex extends SpecialAllpages { 'prefix' => $prefix ); - if( $namespace ) { + if( $namespace || ($prefix == '')) { + // Keep the namespace even if it's 0 for empty prefixes. + // This tells us we're not just a holdover from old links. $query['namespace'] = $namespace; } - $nextLink = Linker::linkKnown( $self, wfMsgHtml( 'nextpage', str_replace( '_',' ', htmlspecialchars( $s->page_title ) ) ),