From d7a9ec39753e60b74b1548a0d98a4fb1be401a3a Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Tue, 6 Jan 2026 17:31:18 -0400 Subject: [PATCH 1/4] Stop checking that json last error exists --- classes/helpers/FrmAppHelper.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/classes/helpers/FrmAppHelper.php b/classes/helpers/FrmAppHelper.php index 7c1e6f52e1..9ba9d15ce6 100644 --- a/classes/helpers/FrmAppHelper.php +++ b/classes/helpers/FrmAppHelper.php @@ -3692,19 +3692,15 @@ public static function maybe_json_decode( $string, $single_to_array = true ) { return $string; } - $new_string = json_decode( $string, true ); + $new_string = json_decode( $string, true ); + $single_value = false; - if ( function_exists( 'json_last_error' ) ) { - // php 5.3+ - $single_value = false; - - if ( ! $single_to_array ) { - $single_value = is_array( $new_string ) && count( $new_string ) === 1 && isset( $new_string[0] ); - } + if ( ! $single_to_array ) { + $single_value = is_array( $new_string ) && count( $new_string ) === 1 && isset( $new_string[0] ); + } - if ( json_last_error() === JSON_ERROR_NONE && is_array( $new_string ) && ! $single_value ) { - $string = $new_string; - } + if ( json_last_error() === JSON_ERROR_NONE && is_array( $new_string ) && ! $single_value ) { + $string = $new_string; } return $string; From 88a825e81cd446f75c0be68f52419f03bffc0a73 Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Tue, 6 Jan 2026 17:33:09 -0400 Subject: [PATCH 2/4] Expect types --- classes/helpers/FrmAppHelper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/helpers/FrmAppHelper.php b/classes/helpers/FrmAppHelper.php index 9ba9d15ce6..4b3ba7ff93 100644 --- a/classes/helpers/FrmAppHelper.php +++ b/classes/helpers/FrmAppHelper.php @@ -3682,10 +3682,10 @@ public static function maybe_unserialize_array( $value ) { * Decode a JSON string. * Do not switch shortcodes like [24] to array unless intentional ie XML values. * - * @param mixed $string - * @param bool $single_to_array + * @param array|string|null $string + * @param bool $single_to_array * - * @return mixed + * @return array|string|null */ public static function maybe_json_decode( $string, $single_to_array = true ) { if ( is_array( $string ) || is_null( $string ) ) { From b7c8f54672a6500e4d8c478b3c24f9fda1f7ca26 Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Tue, 6 Jan 2026 17:35:25 -0400 Subject: [PATCH 3/4] Ignore psalm issue --- psalm.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/psalm.xml b/psalm.xml index 2fdb84e2ac..b6a810f765 100644 --- a/psalm.xml +++ b/psalm.xml @@ -520,6 +520,7 @@ + From b26e183d24fb5fc616be06e0cb9a187b600f80c5 Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Tue, 6 Jan 2026 17:36:44 -0400 Subject: [PATCH 4/4] Ignore psalm issue --- psalm.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/psalm.xml b/psalm.xml index b6a810f765..0b30fa49cb 100644 --- a/psalm.xml +++ b/psalm.xml @@ -523,6 +523,11 @@ + + + + +