Skip to content

Commit

Permalink
Avoid strlen for admin submenu items (#43884)
Browse files Browse the repository at this point in the history
  • Loading branch information
chmst authored Oct 31, 2024
1 parent c9057e1 commit e3cc332
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,14 @@ protected function getTypeOptionsFromManifest($component)
$request['sub'] = (string) $attributes->sub;
}

$o->request = array_filter($request, 'strlen');
$o->request = array_filter($request, function ($value) {
if (\is_array($value)) {
return !empty($value);
}

return \strlen($value);
});

$options[] = new CMSObject($o);

// Do not repeat the default view link (index.php?option=com_abc).
Expand Down

0 comments on commit e3cc332

Please sign in to comment.