Browse Source

Fixes #11125: Fixed `JSON_ERROR_SYNTAX` for `json_decode(null)` in PHP 7

tags/2.0.8
fps01 9 years ago committed by Alexander Makarov
parent
commit
258175149d
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/helpers/BaseJson.php

1
framework/CHANGELOG.md

@ -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)

2
framework/helpers/BaseJson.php

@ -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());

Loading…
Cancel
Save