| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @package FireBox |
| 4 | - * @version 3.1.8 | |
| 4 | + * @version 3.1.14 | |
| 5 | 5 | * |
| 6 | 6 | * @author FirePlugins <[email protected]> |
| 7 | 7 | * @link https://www.fireplugins.com |
| 8 | 8 | * @copyright Copyright © 2026 FirePlugins All Rights Reserved |
| @@ -687,9 +687,9 @@ | ||
| 687 | 687 | { |
| 688 | 688 | $required_plan_label = self::getRequiredPlanLabel($slug); |
| 689 | 689 | /* translators: %s: Required plan label. */ |
| 690 | 690 | $item['locked_message'] = sprintf(__('Upgrade to %s to connect this integration.', 'firebox'), $required_plan_label); |
| 691 | - /* translators: %s: Required plan label. */ | |
| 691 | + /* translators: %s: Plan name (e.g., Growth) */ | |
| 692 | 692 | $item['upgrade_badge_label'] = sprintf(__('Upgrade to %s', 'firebox'), $required_plan_label); |
| 693 | 693 | $item['upgrade_label'] = sprintf(fpframework()->_('FPF_UNLOCK_X_FEATURE'), $required_plan_label); |
| 694 | 694 | $item['upgrade_plan'] = $required_plan_label; |
| 695 | 695 | $item['current_plan'] = self::getCurrentPlan(); |
| @@ -1160,9 +1160,22 @@ | ||
| 1160 | 1160 | { |
| 1161 | 1161 | $key = $field['key']; |
| 1162 | 1162 | $settings_key = $field['settings_key']; |
| 1163 | 1163 | $value = isset($credentials[$key]) && is_scalar($credentials[$key]) ? trim((string) $credentials[$key]) : ''; |
| 1164 | - $settings[$settings_key] = self::getGlobalAPIKeyEncryption()->encrypt($value); | |
| 1164 | + | |
| 1165 | + $encrypted = self::getGlobalAPIKeyEncryption()->encrypt($value); | |
| 1166 | + | |
| 1167 | + /** | |
| 1168 | + * Fail closed. Storing the raw value under a name that implies encryption | |
| 1169 | + * would leave the credential in the database in cleartext with no signal | |
| 1170 | + * to anyone, so refuse the whole write instead. | |
| 1171 | + */ | |
| 1172 | + if ($encrypted === false) | |
| 1173 | + { | |
| 1174 | + return false; | |
| 1175 | + } | |
| 1176 | + | |
| 1177 | + $settings[$settings_key] = $encrypted; | |
| 1165 | 1178 | } |
| 1166 | 1179 | |
| 1167 | 1180 | return update_option('firebox_settings', $settings); |
| 1168 | 1181 | } |