Skip to content

Commit

Permalink
fix possible notice on PHP8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Dec 21, 2022
1 parent d0886f1 commit be14b70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/Menu/MenuAbstract.php
Expand Up @@ -365,8 +365,8 @@ protected function menuCompare($itemOne, $itemTwo)

if ($itemOne['_order'] == $itemTwo['_order']) {
return strcmp(
@$itemOne['_name'],
@$itemTwo['_name']);
$itemOne['_name'] ?? '',
$itemTwo['_name'] ?? '');
}

return ($itemOne['_order'] < $itemTwo['_order']) ? -1 : 1;
Expand Down

2 comments on commit be14b70

@MatomoForumNotifications

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/deprecated-strcmp/48832/3

@tassoman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Didn't know about null coalescing, thanks!

Please sign in to comment.