Skip to content

Commit

Permalink
Use native json_validate (#49413)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtjamesa authored Dec 17, 2023
1 parent 5d9cf9c commit ddade2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Validation/Concerns/ValidatesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,10 @@ public function validateJson($attribute, $value)
return false;
}

if (function_exists('json_validate')) {
return json_validate($value);
}

json_decode($value);

return json_last_error() === JSON_ERROR_NONE;
Expand Down

0 comments on commit ddade2c

Please sign in to comment.