Skip to content

Commit b196738

Browse files
committed
fix: json check helper function
1 parent 01c63cf commit b196738

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

includes/Core/Util/Helper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ public static function isUserLoggedIn()
235235

236236
public static function isJson($string)
237237
{
238+
if (!\is_string($string) || trim($string) === '') {
239+
return false;
240+
}
241+
238242
json_decode($string);
239243

240244
return json_last_error() === JSON_ERROR_NONE;

0 commit comments

Comments
 (0)