From: Michael M Slusarz Date: Fri, 10 Sep 2010 21:22:47 +0000 (-0600) Subject: Fix setting password if no encryption key exists X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=135601589d7c498e689f6bf9e07eca7bff7b5154;p=horde.git Fix setting password if no encryption key exists --- diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Base.php b/framework/Imap_Client/lib/Horde/Imap/Client/Base.php index 7a10b7fa8..bd1af0744 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Base.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Base.php @@ -145,11 +145,14 @@ abstract class Horde_Imap_Client_Base implements Serializable $this->_params = $params; // Encrypt password. - if (!is_null($this->_params['encryptKey'])) { - $secret = new Horde_Secret(); - $this->_params['password'] = $secret->write($this->_getEncryptKey(), $this->_params['password']); - $this->_params['_passencrypt'] = true; - } + try { + $encrypt_key = $this->_getEncryptKey(); + if (strlen($encrypt_key)) { + $secret = new Horde_Secret(); + $this->_params['password'] = $secret->write($encrypt_key, $this->_params['password']); + $this->_params['_passencrypt'] = true; + } + } catch (Horde_Imap_Client_Exception $e) {} $this->_init(); }