Skip to content

Commit 898d7b8

Browse files
[9.x] Use json_validate (#673)
1 parent 4dfbc9d commit 898d7b8

File tree

3 files changed

+1
-62
lines changed

3 files changed

+1
-62
lines changed

src/Http/Controllers/CP/Traits/PreparesModels.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function prepareModelForPublishForm(Resource $resource, Model $model):
4747
}
4848

4949
// When $value is a JSON string, we need to decode it.
50-
if (Json::isJson($value)) {
50+
if (is_string($value) && json_validate($value)) {
5151
$value = json_decode((string) $value, true);
5252
}
5353

src/Support/Json.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/Support/JsonTest.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)