From 52c1212088f3d0fc2b3d174df7e5167151712286 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Tue, 11 Aug 2009 21:04:56 -0400 Subject: [PATCH] add a place to ensure that $this->_imppgp is initialized --- imp/lib/Mime/Viewer/Pgp.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/imp/lib/Mime/Viewer/Pgp.php b/imp/lib/Mime/Viewer/Pgp.php index d0aec8e37..3e9a620c8 100644 --- a/imp/lib/Mime/Viewer/Pgp.php +++ b/imp/lib/Mime/Viewer/Pgp.php @@ -266,6 +266,16 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver */ protected function _outputPGPKey() { + /* Is PGP active? */ + if (empty($GLOBALS['conf']['gnupg']['path']) || + !$GLOBALS['prefs']->getValue('use_pgp')) { + return array(); + } + + if (empty($this->_imppgp)) { + $this->_imppgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); + } + /* Initialize status message. */ $status = array( 'icon' => Horde::img('mime/encryption.png', 'PGP'), -- 2.11.0