diff --git a/includes/ApiCategoryTree.php b/includes/ApiCategoryTree.php index fcd367a1..6b4968f3 100644 --- a/includes/ApiCategoryTree.php +++ b/includes/ApiCategoryTree.php @@ -147,7 +147,7 @@ class ApiCategoryTree extends ApiBase { ), $this->wanCache::TTL_DAY, static function () use ( $ct, $title, $depth ) { - return trim( $ct->renderChildren( $title, $depth ) ); + return $ct->renderChildren( $title, $depth ); }, [ 'touchedCallback' => function () { diff --git a/includes/CategoryTree.php b/includes/CategoryTree.php index 0c9188b6..1a84af84 100644 --- a/includes/CategoryTree.php +++ b/includes/CategoryTree.php @@ -81,14 +81,8 @@ class CategoryTree { public function getTag( string $category, bool $hideroot = false, array $attr = [], int $depth = 1 ) { - $category = trim( $category ); - if ( $category === '' ) { - return false; - } - $title = self::makeTitle( $category ); - - if ( $title === null ) { + if ( !$title ) { return false; }