From 78b97fe94319406804ad93d630ec79aa51080d3c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 21 Apr 2005 03:56:05 +0000 Subject: [PATCH] * Fixing a bug that happened with a certain mix of namespace and invert options. --- includes/SpecialAllpages.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 78a87e727e..70f52eaaf0 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -226,7 +226,7 @@ function indexShowChunk( $namespace = NS_MAIN, $from, $invert ) { $fromTitle = Title::newFromURL( $from ); $fromKey = is_null( $fromTitle ) ? '' : $fromTitle->getDBkey(); - $sql = "SELECT page_namespace, page_title FROM $page WHERE page_namespace" . + $sql = "SELECT page_namespace,page_title FROM $page WHERE page_namespace" . ($invert ? '!' : '') . "=$namespace" . " AND page_title >= ". $dbr->addQuotes( $fromKey ) . " ORDER BY page_title LIMIT " . $maxPlusOne; @@ -241,12 +241,13 @@ function indexShowChunk( $namespace = NS_MAIN, $from, $invert ) { foreach($namespaces as $key => $ns) { $namespaces[$key] = str_replace('_', ' ', $namespaces[$key]); } - while( ($n < $indexMaxperpage) && ($s = $dbr->fetchObject( $res )) ) { $t = Title::makeTitle( $s->page_namespace, $s->page_title ); if( $t ) { - $link = $sk->makeKnownLinkObj( $t, $t->getText(), false, false, $namespaces[$s->page_namespace] . - (($invert && $namespaces[$s->page_namespace] != NS_MAIN) ? ':' :'') ); + $ns = $s->page_namespace; + $s = $invert && $namespaces[$ns] != $wgContLang->getNsText(NS_MAIN) ? ':' : ''; + $n = $invert ? $namespaces[$ns] : ''; + $link = $sk->makeKnownLinkObj( $t, $t->getText(), false, false, $n . $s ); } else { $link = '[[' . htmlspecialchars( $s->page_title ) . ']]'; } -- 2.20.1