Bug #8228: Fix parsing of armored PGP signed messages
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 19 May 2009 10:45:35 +0000 (04:45 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 19 May 2009 10:45:35 +0000 (04:45 -0600)
Correctly check Content-Type, not Content-Type parameter.

imp/lib/Mime/Viewer/Pgp.php

index 501afee..ab90ca6 100644 (file)
@@ -340,11 +340,11 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver
             $signed_data = $GLOBALS['imp_imap']->ob->utils->removeBareNewlines($this->_params['contents']->getBodyPart($signed_id, array('mimeheaders' => true)));
             $sig_part = $this->_params['contents']->getMIMEPart($sig_id);
 
-            /* Check for the 'x-imp-pgp-signature' param. This is set by the
-             * plain driver when parsing PGP armor text. */
+            /* Check for 'x-imp-pgp-signature' type. This is set by the
+             * 'plain' driver when parsing PGP armor text. */
             $graphicsdir = $GLOBALS['registry']->getImageDir('horde');
             try {
-                $sig_result = $sig_part->getContentTypeParameter('x-imp-pgp-signature')
+                $sig_result = ($sig_part->getType() == 'x-imp-pgp-signature')
                     ? $this->_imppgp->verifySignature($signed_data, $this->_address)
                     : $this->_imppgp->verifySignature($signed_data, $this->_address, $sig_part->getContents());