From f2b621875f8c02ec451c8881bd5a27b65fc545e3 Mon Sep 17 00:00:00 2001 From: Thor Brink Date: Tue, 27 Feb 2024 09:26:30 +0000 Subject: [PATCH] fix: undefined array key --- source/php/Helper/Options.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/php/Helper/Options.php b/source/php/Helper/Options.php index 63b16f21..eb7ce17e 100644 --- a/source/php/Helper/Options.php +++ b/source/php/Helper/Options.php @@ -63,9 +63,10 @@ public static function apiKey() public static function publicApiKey() { //Database - $dbOption = self::getOption()['public_api_key']; - if (!empty($dbOption) && is_string($dbOption)) { - return $dbOption; + $options = self::getOption(); + + if (isset($options['public_api_key']) && !empty($options['public_api_key']) && is_string($options['public_api_key'])) { + return $options['public_api_key']; } if (defined('ALGOLIAINDEX_PUBLIC_API_KEY') && !empty(ALGOLIAINDEX_PUBLIC_API_KEY)) {