From: Magnus Manske Date: Wed, 21 Apr 2004 20:28:00 +0000 (+0000) Subject: Category namespaces X-Git-Tag: 1.3.0beta1~348 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=de18da5eebe16c0636fc140f63aeb595df3dc49e;p=lhc%2Fweb%2Fwiklou.git Category namespaces --- diff --git a/includes/Parser.php b/includes/Parser.php index 27bdaaf6cc..c120ad16cf 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -261,7 +261,8 @@ class Parser global $wgLang , $wgUser ; if ( !$this->mOptions->getUseCategoryMagic() ) return ; $id = $this->mTitle->getArticleID() ; - if ( $this->mTitle->getNamespace() != Namespace::getCategory() ) return "" ; + $cns = Namespace::getCategory() ; + if ( $this->mTitle->getNamespace() != $cns ) return "" ; $ti = $this->mTitle->getText() ; $r = "
\n"; @@ -287,9 +288,8 @@ class Parser if ( $t != "" ) $t .= ":" ; $t .= $x->cur_title ; - $y = explode ( ":" , $t , 2 ) ; - if ( count ( $y ) == 2 && $y[0] == $cat ) { - array_push ( $children , $sk->makeLink ( $t , $y[1] ) ) ; + if ( $x->cur_namespace == $cns ) { + array_push ( $children , $sk->makeLink ( $t ) ) ; } else { array_push ( $articles , $sk->makeLink ( $t ) ) ; }