BUG#76 For categories, don't use the Category:-prefix for the sortkey.
authorJens Frank <jeluf@users.mediawiki.org>
Tue, 7 Sep 2004 22:08:01 +0000 (22:08 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Tue, 7 Sep 2004 22:08:01 +0000 (22:08 +0000)
[[Category:Mountains of Panama]] now gets cl_sortkey='Mountains of Panama' instead of 'Category:Mountains of Panama'.
Avoids later issues with sorting.

includes/Parser.php

index e979f2a..f15b4e3 100644 (file)
@@ -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 ;