mdmsoft / yii2-admin

Auth manager for Yii2 (RBAC Manager)
GNU General Public License v3.0
1.16k stars 577 forks source link

Role raise Invalid Parameter [Syntax error] when data is not json #336

Open abpercobaan opened 7 years ago

abpercobaan commented 7 years ago

When i create or update a role and the value of data is not a valid json it will raise Invalid Parameter – yii\base\InvalidParamException Syntax error.

on this line:

$this->_item->data = $this->data === null || $this->data === '' ? null : Json::decode($this->data);

Please validate this.

and by the way, i want to know what's this data used for?

Thanks in advance

phrakon commented 5 years ago

the same issue still presents

https://github.com/yiisoft/yii2/blob/e9b33916b61ecabbe7a754aac7d9f945e4699038/framework/rbac/DbManager.php#L337

uses serialize() instead of Json::decode