From 3ce22a648e743f450bc71f8ea8d902a55415e00c Mon Sep 17 00:00:00 2001 From: Procybit Date: Tue, 6 Aug 2024 01:32:19 +0300 Subject: [PATCH] Skyhigh173/JSON: fix json_is_valid() (#1596) --- extensions/Skyhigh173/json.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/Skyhigh173/json.js b/extensions/Skyhigh173/json.js index c529ea3fa5..22e6d8aaf0 100644 --- a/extensions/Skyhigh173/json.js +++ b/extensions/Skyhigh173/json.js @@ -599,7 +599,9 @@ json_is_valid({ json }) { if (typeof json != "string") { return false; - } else if ( + } + json = json.trim(); + if ( (json.slice(0, 1) != "[" || json.slice(-1) != "]") && (json.slice(0, 1) != "{" || json.slice(-1) != "}") ) {