mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-20 18:32:59 +08:00
fixes #1303: Security::decrypt now returns null w/o error when null is passed as $data
This commit is contained in:
@ -75,6 +75,9 @@ class BaseSecurity
|
|||||||
*/
|
*/
|
||||||
public static function decrypt($data, $password)
|
public static function decrypt($data, $password)
|
||||||
{
|
{
|
||||||
|
if ($data === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
$module = static::openCryptModule();
|
$module = static::openCryptModule();
|
||||||
$ivSize = mcrypt_enc_get_iv_size($module);
|
$ivSize = mcrypt_enc_get_iv_size($module);
|
||||||
$iv = StringHelper::substr($data, 0, $ivSize);
|
$iv = StringHelper::substr($data, 0, $ivSize);
|
||||||
|
Reference in New Issue
Block a user