Skip to content

Commit

Permalink
fix: undefined array key (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorbrink authored Feb 27, 2024
1 parent cef858a commit 001a4bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/php/Helper/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 001a4bd

Please sign in to comment.