From: Ævar Arnfjörð Bjarmason Date: Thu, 21 Apr 2005 03:56:05 +0000 (+0000) Subject: * Fixing a bug that happened with a certain mix of namespace and invert options. X-Git-Tag: 1.5.0alpha1~215 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=78b97fe94319406804ad93d630ec79aa51080d3c;p=lhc%2Fweb%2Fwiklou.git * Fixing a bug that happened with a certain mix of namespace and invert options. --- 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 ) . ']]'; }