From c17e3a9d7eaf36d656d5777495f3618cd3afa690 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 23 Dec 2019 12:01:22 -0800 Subject: [PATCH] Removing bad array references that broke in PHP 7.4 as a result of calling an array offset on a null value/property (#113) --- src/Item.php | 2 +- src/Menu.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Item.php b/src/Item.php index 016c2e8..48803df 100755 --- a/src/Item.php +++ b/src/Item.php @@ -320,7 +320,7 @@ public function checkActiveStatus() $path = ltrim(parse_url($this->url(), PHP_URL_PATH), '/'); $requestPath = Request::path(); - if ($this->builder->config['rest_base']) { + if (isset($this->builder->config) && $this->builder->config['rest_base']) { $base = (is_array($this->builder->config['rest_base'])) ? implode('|', $this->builder->config['rest_base']) : $this->builder->conf['rest_base']; list($path, $requestPath) = preg_replace('@^('.$base.')/@', '', [$path, $requestPath], 1); diff --git a/src/Menu.php b/src/Menu.php index 9e21c3c..9a12930 100755 --- a/src/Menu.php +++ b/src/Menu.php @@ -63,7 +63,7 @@ public function loadConfig($name) return array_merge($options['default'], $options[$name]); } - return $options['default']; + return $options['default'] ?? null; } /**