From: Jens Frank Date: Tue, 7 Sep 2004 22:08:01 +0000 (+0000) Subject: BUG#76 For categories, don't use the Category:-prefix for the sortkey. X-Git-Tag: 1.5.0alpha1~2061 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22messagerie%22%29%20.%20%22?a=commitdiff_plain;h=227b54cbfdbe0888c4ae44854298f53f93f07708;p=lhc%2Fweb%2Fwiklou.git BUG#76 For categories, don't use the Category:-prefix for the sortkey. [[Category:Mountains of Panama]] now gets cl_sortkey='Mountains of Panama' instead of 'Category:Mountains of Panama'. Avoids later issues with sorting. --- diff --git a/includes/Parser.php b/includes/Parser.php index e979f2a00c..f15b4e38d6 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1105,7 +1105,15 @@ class Parser $sk->postParseLinkColour( $pPLC ); $wgLinkCache->resume(); - $sortkey = $wasblank ? $this->mTitle->getPrefixedText() : $text; + if ( $wasblank ) { + if ( $this->mTitle->getNamespace() == NS_CATEGORY ) { + $sortkey = $this->mTitle->getText(); + } else { + $sortkey = $this->mTitle->getPrefixedText(); + } + } else { + $sortkey = $text; + } $wgLinkCache->addCategoryLinkObj( $nt, $sortkey ); $this->mOutput->mCategoryLinks[] = $t ; $s .= $prefix . $trail ;