Skip to content

Commit

Permalink
Prevent potential PHP8.2 warnings
Browse files Browse the repository at this point in the history
Method setEmailAddresses now ensures that entry in tb_configuration
table contains either valid string, or does not exists. Therefore, null
value should never be stored in tb_configuration table for
COLLECTLOGS_NEW_ERRORS_EMAIL configuration key.

However, previous version of module did not do this check, so in some
cases NULL is actually stored inside db table.

Let's account for this situation.

Closes #8
  • Loading branch information
getdatakick committed Dec 29, 2022
1 parent 51b9b89 commit a7c204a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function setSendNewErrorsEmail($value)
public function getEmailAddresses()
{
$strValue = Configuration::getGlobalValue(static::SETTINGS_NEW_ERRORS_EMAIL_ADDRESSES);
if ($strValue === false) {
if (is_null($strValue) || $strValue === false) {
return [];
}
return explode("\n", $strValue);
Expand Down

0 comments on commit a7c204a

Please sign in to comment.