From 227b54cbfdbe0888c4ae44854298f53f93f07708 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Tue, 7 Sep 2004 22:08:01 +0000 Subject: [PATCH] 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. --- includes/Parser.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 ; -- 2.20.1