From f194684d4bf38db91856b02e7a7b17bd097bc5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 8 Oct 2023 17:55:11 +0800 Subject: [PATCH] eee --- TypesOfValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TypesOfValidator.php b/TypesOfValidator.php index 5e4cd55..9844e56 100644 --- a/TypesOfValidator.php +++ b/TypesOfValidator.php @@ -63,7 +63,7 @@ class TypesOfValidator extends BaseValidator */ public function jsonFormat($field, $value): bool { - if (is_null(json_decode($value))) { + if (!is_string($value) || is_null(json_decode($value))) { return $this->addError($field, 'The ' . $field . ' not is JSON data.'); } return true;