From 454a9ee52ebffd4a1a0b31a1f54348f955d51a38 Mon Sep 17 00:00:00 2001
From: Alexander Makarov <sam@rmcreative.ru>
Date: Sat, 23 Nov 2013 19:44:03 +0400
Subject: [PATCH] fixes #1303: Security::decrypt now returns null w/o error when null is passed as $data

---
 framework/yii/helpers/BaseSecurity.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/framework/yii/helpers/BaseSecurity.php b/framework/yii/helpers/BaseSecurity.php
index 8e86654..03af81d 100644
--- a/framework/yii/helpers/BaseSecurity.php
+++ b/framework/yii/helpers/BaseSecurity.php
@@ -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);
--
libgit2 0.27.1