mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #11125: Fixed JSON_ERROR_SYNTAX
for json_decode(null)
in PHP 7
This commit is contained in:
@ -14,6 +14,7 @@ Yii Framework 2 Change Log
|
||||
- Bug #10974: `yii.js` - fixed error in ajaxPrefilter event handler, caused by blocked frame (maximal)
|
||||
- Bug #11038: Fixed handling of intervals of 0 seconds in `yii\i18n\Formatter::asDuration()` (VirtualRJ)
|
||||
- Bug #11093: Fixed `yii\db\QueryBuilder::buildAndCondition()` to add query params passed directly by `yii\db\Expression` (CedricYii, silverfire)
|
||||
- Bug #11125: Fixed `JSON_ERROR_SYNTAX` for `json_decode(null)` in PHP 7 (fps01)
|
||||
- Bug: SQlite querybuilder did not create primary key with bigint for `TYPE_BIGPK` (cebe)
|
||||
- Enh #5469: Add mimetype validation by mask in FileValidator (kirsenn, samdark, silverfire)
|
||||
- Enh #8602: `yii\validators\DateValidator` skip validation for `timestampAttribute`, if it is already in correct format (klimov-paul)
|
||||
|
@ -90,6 +90,8 @@ class BaseJson
|
||||
{
|
||||
if (is_array($json)) {
|
||||
throw new InvalidParamException('Invalid JSON data.');
|
||||
} elseif ($json === null || $json === '') {
|
||||
return null;
|
||||
}
|
||||
$decode = json_decode((string) $json, $asArray);
|
||||
static::handleJsonError(json_last_error());
|
||||
|
Reference in New Issue
Block a user