fixes #1303: Security::decrypt now returns null w/o error when null is passed as $data

This commit is contained in:
Alexander Makarov
2013-11-23 19:44:03 +04:00
parent 5e1154217a
commit 454a9ee52e

View File

@ -75,6 +75,9 @@ class BaseSecurity
*/
public static function decrypt($data, $password)
{
if ($data === null) {
return null;
}
$module = static::openCryptModule();
$ivSize = mcrypt_enc_get_iv_size($module);
$iv = StringHelper::substr($data, 0, $ivSize);