Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ddade2c

Browse files
authored
Use native json_validate (#49413)
1 parent 5d9cf9c commit ddade2c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Validation/Concerns/ValidatesAttributes.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,10 @@ public function validateJson($attribute, $value)
14381438
return false;
14391439
}
14401440

1441+
if (function_exists('json_validate')) {
1442+
return json_validate($value);
1443+
}
1444+
14411445
json_decode($value);
14421446

14431447
return json_last_error() === JSON_ERROR_NONE;

0 commit comments

Comments
 (0)