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
2023-03-01 19:49:52 -05:00
parent 32ba4a9545
commit 706adf44cd
5 changed files with 51 additions and 8 deletions

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
{