This commit addresses the scenario where encryption fails when the value to be encrypted is either FALSE or blank. I'm testing for !empty before doing encryption/decryption on the value and that seems to be working with this commit.

This commit is contained in:
Steve Ireland committed 2023-04-27 21:54:11 -04:00
1 parent 32ba4a9545
commit 706adf44cd
5 files changed
+51 -8

No files matched your search

+19 -2
View File
@@ -283,8 +283,25 @@ class Config extends Secure_Controller
{
$encrypter = Services::encrypter();
$data['mailchimp']['api_key'] = $encrypter->decrypt($this->config['mailchimp_api_key'] ?? '');
$data['mailchimp']['list_id'] = $encrypter->decrypt($this->config['mailchimp_list_id'] ?? '');
$mailchimp_api_key = $this->config['mailchimp_api_key'];
if(!empty($mailchimp_api_key))
{
$data['mailchimp']['api_key'] = $encrypter->decrypt($mailchimp_api_key);
}
else
{
$data['mailchimp']['api_key'] = '';
}
$mailchimp_list_id = $this->config['mailchimp_list_id'];
if(!empty($mailchimp_list_id))
{
$data['mailchimp']['list_id'] = $encrypter->decrypt($mailchimp_list_id);
}
else
{
$data['mailchimp']['list_id'] = '';
}
}
else
{