mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-27 09:43:06 +00:00
Remove duplicate/unnecessary trim
CategoryTree::makeTitle also makes a trim and an early return. A trim on the return value of renderChildren() is not needed. Change-Id: I1fc2705277491797eb6c0d0900152b63913ca875
This commit is contained in:
parent
921e6fe3f9
commit
092797b0e2
|
@ -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 () {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue