Skip to content

Commit

Permalink
[3.10] [PHP 8.1] Fixes mod_menu/menu.php type null instead of string (j…
Browse files Browse the repository at this point in the history
…oomla#36773)

* [3.10] [PHP 8.1] Fixes mod_menu/menu.php type null instead of string

Fixes Deprecated: trim(): `Passing null to parameter #1 ($string) of type string is deprecated in administrator/modules/mod_menu/menu.php on line 383`

* [PHP 8.1] admin mod_menu: Slightly cleaner fix for joomla#36773
  • Loading branch information
beat authored Jan 23, 2022
1 parent b90fb91 commit 0a1c48f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion administrator/modules/mod_menu/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ protected function preprocess($items)
}

// Exclude if link is invalid
if (!in_array($item->type, array('separator', 'heading', 'container')) && trim($item->link) === '')
if (is_null($item->link) || (!in_array($item->type, array('separator', 'heading', 'container')) && trim($item->link) === ''))
{
continue;
}
Expand Down

0 comments on commit 0a1c48f

Please sign in to comment.