From 6d8cbbd891266061f0e67795aa55cf9fcc9ba6e0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 18 Sep 2007 15:52:30 +0000 Subject: [PATCH] * (bug 11383) Don't pull subcategories for non-category pages in category tree --- CategoryTreeFunctions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CategoryTreeFunctions.php b/CategoryTreeFunctions.php index 408814cf..6667e246 100644 --- a/CategoryTreeFunctions.php +++ b/CategoryTreeFunctions.php @@ -166,6 +166,11 @@ class CategoryTree { function renderChildren( &$title, $mode = NULL, $depth=0 ) { global $wgCategoryTreeMaxChildren, $wgCategoryTreeDefaultMode; + if( $title->getNamespace() != NS_CATEGORY ) { + // Non-categories can't have children. :) + return ''; + } + $dbr =& wfGetDB( DB_SLAVE ); #additional stuff to be used if "transaltion" by interwiki-links is desired