From 07db37945d4c6e81b4ecb6f3b9d282351e7d0cae Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Wed, 9 Jun 2004 12:07:32 +0000 Subject: [PATCH] Don't show underscores instead of spaces for subcategories. BUG #969473 --- includes/Parser.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index a2e058cb25..7e2c3047d5 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -416,7 +416,7 @@ class Parser if ( !$this->mOptions->getUseCategoryMagic() ) return ; # Doesn't use categories at all $cns = Namespace::getCategory() ; - if ( $this->mTitle->getNamespace() != $cns ) return "" ; # This ain't a category page + if ( $this->mTitle->getNamespace() != $cns ) return '' ; # This ain't a category page $r = "
\n"; @@ -437,19 +437,13 @@ cur,categorylinks WHERE cl_to='$t' AND cl_from=cur_id ORDER BY cl_sortkey" ; $res = wfQuery ( $sql, DB_READ ) ; while ( $x = wfFetchObject ( $res ) ) - { - $data[] = $x ; - } - - # For all pages that link to this category - foreach ( $data as $x ) { $t = $wgLang->getNsText ( $x->cur_namespace ) ; if ( $t != '' ) $t .= ':' ; $t .= $x->cur_title ; if ( $x->cur_namespace == $cns ) { - array_push ( $children, $sk->makeKnownLink ( $t, $x->cur_title) ) ; # Subcategory + array_push ( $children, $sk->makeKnownLink ( $t, str_replace( '_',' ',$x->cur_title) ) ) ; # Subcategory array_push ( $children_start_char, $wgLang->firstChar( $x->cur_title ) ) ; } else { array_push ( $articles , $sk->makeLink ( $t ) ) ; # Page in this category @@ -464,7 +458,7 @@ cl_sortkey" ; if ( count ( $children ) > 0 ) { # Showing subcategories - $r .= '

' . wfMsg( "subcategories" ) . "

\n" + $r .= '

' . wfMsg( 'subcategories' ) . "

\n" . wfMsg( 'subcategorycount', count( $children ) ); if ( count ( $children ) > 20) { -- 2.20.1