Description
The SLA page (/slas) only displayed menu bar.
In the PHP log, we can see this error :
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /opt/observium/21.12.11808/html/pages/slas.inc.php:146\nStack trace:\n#0 /opt/observium/21.12.11808/html/pages/slas.inc.php(146): in_array()\n#1 /opt/observium/21.12.11808/html/index.php(271): include('...')\n#2 {main}\n thrown in /opt/observium/21.12.11808/html/pages/slas.inc.php on line 146' |
I thiking it's related to PHP 8.0.
I solved the problem with this code modification line 146:
- if ($owner == $vars['owner'] || in_array($owner, $vars['owner']) ) |
+ if ($owner == $vars['owner'] || (!safe_empty($vars['owner']) && in_array($owner, $vars['owner'])) ) |
I don't know if this is the official method for Observium, but it works