From e73d6e0e507fccad73d71be734874749f76bc7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ruz=CC=8Cevic=CC=81?= Date: Thu, 12 Dec 2024 15:05:20 +0100 Subject: [PATCH] updating fix for use conditions --- CHANGELOG.md | 7 +++++++ eightshift-forms.php | 2 +- src/Captcha/SettingsCaptcha.php | 12 ++++++------ .../ActiveCampaign/SettingsActiveCampaign.php | 6 +++--- src/Integrations/Airtable/SettingsAirtable.php | 4 ++-- src/Integrations/Clearbit/SettingsClearbit.php | 2 +- src/Integrations/Corvus/SettingsCorvus.php | 4 ++-- src/Integrations/Goodbits/SettingsGoodbits.php | 4 ++-- src/Integrations/Greenhouse/SettingsGreenhouse.php | 6 +++--- src/Integrations/Hubspot/SettingsHubspot.php | 4 ++-- src/Integrations/Jira/SettingsJira.php | 8 ++++---- src/Integrations/Mailchimp/SettingsMailchimp.php | 4 ++-- src/Integrations/Mailerlite/SettingsMailerlite.php | 4 ++-- src/Integrations/Moments/SettingsMoments.php | 6 +++--- src/Integrations/Paycek/SettingsPaycek.php | 6 +++--- src/Integrations/Pipedrive/SettingsPipedrive.php | 4 ++-- src/Integrations/Talentlyft/SettingsTalentlyft.php | 4 ++-- src/Integrations/Workable/SettingsWorkable.php | 6 +++--- 18 files changed, 50 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0005f368..6229f5e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). +## [5.6.3] + +### Fixed + +- Broken Use conditions on settings + ## [5.6.2] ### Fixed @@ -854,6 +860,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a - Initial production release. +[5.6.3]: https://github.com/infinum/eightshift-forms/compare/5.6.2...5.6.3 [5.6.2]: https://github.com/infinum/eightshift-forms/compare/5.6.1...5.6.2 [5.6.1]: https://github.com/infinum/eightshift-forms/compare/5.6.0...5.6.1 [5.6.0]: https://github.com/infinum/eightshift-forms/compare/5.5.1...5.6.0 diff --git a/eightshift-forms.php b/eightshift-forms.php index 62b38edd..b4fd46f0 100644 --- a/eightshift-forms.php +++ b/eightshift-forms.php @@ -6,7 +6,7 @@ * Description: Eightshift Forms is a complete form builder plugin that utilizes modern Block editor features with multiple third-party integrations, bringing your project to a new level. * Author: WordPress team @Infinum * Author URI: https://eightshift.com/ - * Version: 5.6.2 + * Version: 5.6.3 * Text Domain: eightshift-forms * * @package EightshiftForms diff --git a/src/Captcha/SettingsCaptcha.php b/src/Captcha/SettingsCaptcha.php index 47b7efd7..0ea1ea4e 100644 --- a/src/Captcha/SettingsCaptcha.php +++ b/src/Captcha/SettingsCaptcha.php @@ -134,19 +134,19 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_CAPTCHA_USE_KEY, self::SETTINGS_CAPTCHA_USE_KEY); - $siteKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getGoogleReCaptchaSiteKey(), self::SETTINGS_CAPTCHA_SITE_KEY)['value']; - $secretKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getGoogleReCaptchaSecretKey(), self::SETTINGS_CAPTCHA_SECRET_KEY)['value']; - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getGoogleReCaptchaApiKey(), self::SETTINGS_CAPTCHA_API_KEY)['value']; - $projectIdKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getGoogleReCaptchaProjectIdKey(), self::SETTINGS_CAPTCHA_PROJECT_ID_KEY)['value']; + $siteKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getGoogleReCaptchaSiteKey(), self::SETTINGS_CAPTCHA_SITE_KEY)['value']; + $secretKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getGoogleReCaptchaSecretKey(), self::SETTINGS_CAPTCHA_SECRET_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getGoogleReCaptchaApiKey(), self::SETTINGS_CAPTCHA_API_KEY)['value']; + $projectIdKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getGoogleReCaptchaProjectIdKey(), self::SETTINGS_CAPTCHA_PROJECT_ID_KEY)['value']; $isEnterprise = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_CAPTCHA_ENTERPRISE_KEY, self::SETTINGS_CAPTCHA_ENTERPRISE_KEY); if ($isEnterprise) { - if (!$isUsed || empty($siteKey) || empty($apiKey) || empty($projectIdKey)) { + if (!$isUsed || !$siteKey || !$apiKey || !$projectIdKey) { return false; } } else { - if (!$isUsed || empty($siteKey) || empty($secretKey)) { + if (!$isUsed || !$siteKey || !$secretKey) { return false; } } diff --git a/src/Integrations/ActiveCampaign/SettingsActiveCampaign.php b/src/Integrations/ActiveCampaign/SettingsActiveCampaign.php index 57650d9b..bc419195 100644 --- a/src/Integrations/ActiveCampaign/SettingsActiveCampaign.php +++ b/src/Integrations/ActiveCampaign/SettingsActiveCampaign.php @@ -88,10 +88,10 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(SettingsActiveCampaign::SETTINGS_ACTIVE_CAMPAIGN_USE_KEY, SettingsActiveCampaign::SETTINGS_ACTIVE_CAMPAIGN_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyActiveCampaign(), self::SETTINGS_ACTIVE_CAMPAIGN_API_KEY_KEY)['value']; - $url = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiUrlActiveCampaign(), self::SETTINGS_ACTIVE_CAMPAIGN_API_URL_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyActiveCampaign(), self::SETTINGS_ACTIVE_CAMPAIGN_API_KEY_KEY)['value']; + $url = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiUrlActiveCampaign(), self::SETTINGS_ACTIVE_CAMPAIGN_API_URL_KEY)['value']; - if (!$isUsed || empty($apiKey) || empty($url)) { + if (!$isUsed || !$apiKey || !$url) { return false; } diff --git a/src/Integrations/Airtable/SettingsAirtable.php b/src/Integrations/Airtable/SettingsAirtable.php index 73a52187..e1b1f6e0 100644 --- a/src/Integrations/Airtable/SettingsAirtable.php +++ b/src/Integrations/Airtable/SettingsAirtable.php @@ -82,9 +82,9 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_AIRTABLE_USE_KEY, self::SETTINGS_AIRTABLE_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyAirtable(), self::SETTINGS_AIRTABLE_API_KEY_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyAirtable(), self::SETTINGS_AIRTABLE_API_KEY_KEY)['value']; - if (!$isUsed || empty($apiKey)) { + if (!$isUsed || !$apiKey) { return false; } diff --git a/src/Integrations/Clearbit/SettingsClearbit.php b/src/Integrations/Clearbit/SettingsClearbit.php index 706cf359..13921a0f 100644 --- a/src/Integrations/Clearbit/SettingsClearbit.php +++ b/src/Integrations/Clearbit/SettingsClearbit.php @@ -147,7 +147,7 @@ public function isSettingsValid(string $formId, string $type): bool public function isSettingsGlobalValid(string $type = ''): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_CLEARBIT_USE_KEY, self::SETTINGS_CLEARBIT_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyClearbit(), self::SETTINGS_CLEARBIT_API_KEY_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyClearbit(), self::SETTINGS_CLEARBIT_API_KEY_KEY)['value']; $map = !empty($type) ? UtilsSettingsHelper::getOptionValueGroup(self::SETTINGS_CLEARBIT_MAP_HUBSPOT_KEYS_KEY . '-' . $type) : true; if (!$isUsed || !$apiKey || !$map) { diff --git a/src/Integrations/Corvus/SettingsCorvus.php b/src/Integrations/Corvus/SettingsCorvus.php index 9b4e145b..a9cd74b3 100644 --- a/src/Integrations/Corvus/SettingsCorvus.php +++ b/src/Integrations/Corvus/SettingsCorvus.php @@ -584,9 +584,9 @@ static function ($option) use ($mapParams, $item) { public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_CORVUS_USE_KEY, self::SETTINGS_CORVUS_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyCorvus(), self::SETTINGS_CORVUS_API_KEY_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyCorvus(), self::SETTINGS_CORVUS_API_KEY_KEY)['value']; - if (!$isUsed || empty($apiKey)) { + if (!$isUsed || !$apiKey) { return false; } diff --git a/src/Integrations/Goodbits/SettingsGoodbits.php b/src/Integrations/Goodbits/SettingsGoodbits.php index b630423b..1bc54a98 100644 --- a/src/Integrations/Goodbits/SettingsGoodbits.php +++ b/src/Integrations/Goodbits/SettingsGoodbits.php @@ -82,9 +82,9 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_GOODBITS_USE_KEY, self::SETTINGS_GOODBITS_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyGoodbits(), self::SETTINGS_GOODBITS_API_KEY_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyGoodbits(), self::SETTINGS_GOODBITS_API_KEY_KEY)['value']; - if (!$isUsed || empty($apiKey)) { + if (!$isUsed || !$apiKey) { return false; } diff --git a/src/Integrations/Greenhouse/SettingsGreenhouse.php b/src/Integrations/Greenhouse/SettingsGreenhouse.php index f8ef6491..8fa0bab0 100644 --- a/src/Integrations/Greenhouse/SettingsGreenhouse.php +++ b/src/Integrations/Greenhouse/SettingsGreenhouse.php @@ -105,10 +105,10 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_GREENHOUSE_USE_KEY, self::SETTINGS_GREENHOUSE_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyGreenhouse(), self::SETTINGS_GREENHOUSE_API_KEY_KEY)['value']; - $boardToken = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getBoardTokenGreenhouse(), self::SETTINGS_GREENHOUSE_BOARD_TOKEN_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyGreenhouse(), self::SETTINGS_GREENHOUSE_API_KEY_KEY)['value']; + $boardToken = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getBoardTokenGreenhouse(), self::SETTINGS_GREENHOUSE_BOARD_TOKEN_KEY)['value']; - if (!$isUsed || empty($apiKey) || empty($boardToken)) { + if (!$isUsed || !$apiKey || !$boardToken) { return false; } diff --git a/src/Integrations/Hubspot/SettingsHubspot.php b/src/Integrations/Hubspot/SettingsHubspot.php index 9c3015c8..d6917a47 100644 --- a/src/Integrations/Hubspot/SettingsHubspot.php +++ b/src/Integrations/Hubspot/SettingsHubspot.php @@ -122,9 +122,9 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(SettingsHubspot::SETTINGS_HUBSPOT_USE_KEY, SettingsHubspot::SETTINGS_HUBSPOT_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyHubspot(), self::SETTINGS_HUBSPOT_API_KEY_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyHubspot(), self::SETTINGS_HUBSPOT_API_KEY_KEY)['value']; - if (!$isUsed || empty($apiKey)) { + if (!$isUsed || !$apiKey) { return false; } diff --git a/src/Integrations/Jira/SettingsJira.php b/src/Integrations/Jira/SettingsJira.php index cd3014fe..35638be8 100644 --- a/src/Integrations/Jira/SettingsJira.php +++ b/src/Integrations/Jira/SettingsJira.php @@ -355,11 +355,11 @@ function ($item) use ($mapParams) { public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_JIRA_USE_KEY, self::SETTINGS_JIRA_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyJira(), self::SETTINGS_JIRA_API_KEY_KEY)['value']; - $apiBoard = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiBoardJira(), self::SETTINGS_JIRA_API_BOARD_KEY)['value']; - $apiUser = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiUserJira(), self::SETTINGS_JIRA_API_USER_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyJira(), self::SETTINGS_JIRA_API_KEY_KEY)['value']; + $apiBoard = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiBoardJira(), self::SETTINGS_JIRA_API_BOARD_KEY)['value']; + $apiUser = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiUserJira(), self::SETTINGS_JIRA_API_USER_KEY)['value']; - if (!$isUsed || empty($apiKey) || empty($apiBoard) || empty($apiUser)) { + if (!$isUsed || !$apiKey || !$apiBoard || !$apiUser) { return false; } diff --git a/src/Integrations/Mailchimp/SettingsMailchimp.php b/src/Integrations/Mailchimp/SettingsMailchimp.php index 020127a8..d2696828 100644 --- a/src/Integrations/Mailchimp/SettingsMailchimp.php +++ b/src/Integrations/Mailchimp/SettingsMailchimp.php @@ -88,9 +88,9 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_MAILCHIMP_USE_KEY, self::SETTINGS_MAILCHIMP_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyMailchimp(), self::SETTINGS_MAILCHIMP_API_KEY_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyMailchimp(), self::SETTINGS_MAILCHIMP_API_KEY_KEY)['value']; - if (!$isUsed || empty($apiKey)) { + if (!$isUsed || !$apiKey) { return false; } diff --git a/src/Integrations/Mailerlite/SettingsMailerlite.php b/src/Integrations/Mailerlite/SettingsMailerlite.php index ec60f099..1a08272d 100644 --- a/src/Integrations/Mailerlite/SettingsMailerlite.php +++ b/src/Integrations/Mailerlite/SettingsMailerlite.php @@ -82,9 +82,9 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_MAILERLITE_USE_KEY, self::SETTINGS_MAILERLITE_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyMailerlite(), self::SETTINGS_MAILERLITE_API_KEY_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyMailerlite(), self::SETTINGS_MAILERLITE_API_KEY_KEY)['value']; - if (!$isUsed || empty($apiKey)) { + if (!$isUsed || !$apiKey) { return false; } diff --git a/src/Integrations/Moments/SettingsMoments.php b/src/Integrations/Moments/SettingsMoments.php index c8cd7aee..84b492f5 100644 --- a/src/Integrations/Moments/SettingsMoments.php +++ b/src/Integrations/Moments/SettingsMoments.php @@ -115,10 +115,10 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_MOMENTS_USE_KEY, self::SETTINGS_MOMENTS_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyMoments(), self::SETTINGS_MOMENTS_API_KEY_KEY)['value']; - $url = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiUrlMoments(), self::SETTINGS_MOMENTS_API_URL_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyMoments(), self::SETTINGS_MOMENTS_API_KEY_KEY)['value']; + $url = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiUrlMoments(), self::SETTINGS_MOMENTS_API_URL_KEY)['value']; - if (!$isUsed || empty($apiKey) || empty($url)) { + if (!$isUsed || !$apiKey || !$url) { return false; } diff --git a/src/Integrations/Paycek/SettingsPaycek.php b/src/Integrations/Paycek/SettingsPaycek.php index f410d369..f16bb32b 100644 --- a/src/Integrations/Paycek/SettingsPaycek.php +++ b/src/Integrations/Paycek/SettingsPaycek.php @@ -322,10 +322,10 @@ static function ($option) use ($mapParams, $item) { public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_PAYCEK_USE_KEY, self::SETTINGS_PAYCEK_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyPaycek(), self::SETTINGS_PAYCEK_API_KEY_KEY)['value']; - $profileKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiProfileKeyPaycek(), self::SETTINGS_PAYCEK_API_PROFILE_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyPaycek(), self::SETTINGS_PAYCEK_API_KEY_KEY)['value']; + $profileKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiProfileKeyPaycek(), self::SETTINGS_PAYCEK_API_PROFILE_KEY)['value']; - if (!$isUsed || empty($apiKey) || empty($profileKey)) { + if (!$isUsed || !$apiKey || !$profileKey) { return false; } diff --git a/src/Integrations/Pipedrive/SettingsPipedrive.php b/src/Integrations/Pipedrive/SettingsPipedrive.php index bfa07bc3..b5e7423e 100644 --- a/src/Integrations/Pipedrive/SettingsPipedrive.php +++ b/src/Integrations/Pipedrive/SettingsPipedrive.php @@ -523,9 +523,9 @@ static function ($option) use ($organization) { public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_PIPEDRIVE_USE_KEY, self::SETTINGS_PIPEDRIVE_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyPipedrive(), self::SETTINGS_PIPEDRIVE_API_KEY_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyPipedrive(), self::SETTINGS_PIPEDRIVE_API_KEY_KEY)['value']; - if (!$isUsed || empty($apiKey)) { + if (!$isUsed || !$apiKey) { return false; } diff --git a/src/Integrations/Talentlyft/SettingsTalentlyft.php b/src/Integrations/Talentlyft/SettingsTalentlyft.php index 3c2b723c..93922405 100644 --- a/src/Integrations/Talentlyft/SettingsTalentlyft.php +++ b/src/Integrations/Talentlyft/SettingsTalentlyft.php @@ -119,9 +119,9 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_TALENTLYFT_USE_KEY, self::SETTINGS_TALENTLYFT_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyTalentlyft(), self::SETTINGS_TALENTLYFT_API_KEY_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyTalentlyft(), self::SETTINGS_TALENTLYFT_API_KEY_KEY)['value']; - if (!$isUsed || empty($apiKey)) { + if (!$isUsed || !$apiKey) { return false; } diff --git a/src/Integrations/Workable/SettingsWorkable.php b/src/Integrations/Workable/SettingsWorkable.php index b2fc1902..982a490d 100644 --- a/src/Integrations/Workable/SettingsWorkable.php +++ b/src/Integrations/Workable/SettingsWorkable.php @@ -98,10 +98,10 @@ public function register(): void public function isSettingsGlobalValid(): bool { $isUsed = UtilsSettingsHelper::isOptionCheckboxChecked(self::SETTINGS_WORKABLE_USE_KEY, self::SETTINGS_WORKABLE_USE_KEY); - $apiKey = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyWorkable(), self::SETTINGS_WORKABLE_API_KEY_KEY)['value']; - $subdomain = UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getSubdomainWorkable(), self::SETTINGS_WORKABLE_SUBDOMAIN_KEY)['value']; + $apiKey = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getApiKeyWorkable(), self::SETTINGS_WORKABLE_API_KEY_KEY)['value']; + $subdomain = (bool) UtilsSettingsHelper::getSettingsDisabledOutputWithDebugFilter(Variables::getSubdomainWorkable(), self::SETTINGS_WORKABLE_SUBDOMAIN_KEY)['value']; - if (!$isUsed || empty($apiKey) || empty($subdomain)) { + if (!$isUsed || !$apiKey || !$subdomain) { return false; }