From adbdf2167a21a091e69e3a14e553ea0d84b2f7ae Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 7 Jul 2010 00:34:22 +0200 Subject: [PATCH] Don't encrypt/decrypt empty messages. --- framework/Secret/lib/Horde/Secret.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/Secret/lib/Horde/Secret.php b/framework/Secret/lib/Horde/Secret.php index 6675daf92..41f400aba 100644 --- a/framework/Secret/lib/Horde/Secret.php +++ b/framework/Secret/lib/Horde/Secret.php @@ -70,7 +70,7 @@ class Horde_Secret */ public function write($key, $message) { - $val = strlen($key) + $val = strlen($key) && strlen($message) ? $this->_getCipherOb($key)->encrypt($message) : ''; @@ -92,7 +92,7 @@ class Horde_Secret */ public function read($key, $ciphertext) { - $val = strlen($key) + $val = strlen($key) && strlen($ciphertext) ? $this->_getCipherOb($key)->decrypt($ciphertext) : ''; -- 2.11.0