Fix encrypt option select list generation
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 8 Jan 2009 03:08:10 +0000 (20:08 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 8 Jan 2009 05:09:16 +0000 (22:09 -0700)
imp/lib/IMP.php

index 3d36858..ee45073 100644 (file)
@@ -1071,12 +1071,12 @@ class IMP
             $default = $GLOBALS['prefs']->getValue('default_encrypt');
         }
 
-        $enc_opts = array();
+        $enc_opts = array(self::ENCRYPT_NONE => _("No Encryption"));
         $output = '';
 
         if (!empty($GLOBALS['conf']['utils']['gnupg']) &&
             $GLOBALS['prefs']->getValue('use_pgp')) {
-            $enc_opts = array(
+            $enc_opts += array(
                 self::PGP_ENCRYPT => _("PGP Encrypt Message"),
                 self::PGP_SIGN => _("PGP Sign Message"),
                 self::PGP_SIGNENC => _("PGP Sign/Encrypt Message"),
@@ -1085,15 +1085,13 @@ class IMP
             );
         }
         if ($GLOBALS['prefs']->getValue('use_smime')) {
-            $enc_opts = array_merge($enc_opts, array(
+            $enc_opts += array(
                 self::SMIME_ENCRYPT => _("S/MIME Encrypt Message"),
                 self::SMIME_SIGN => _("S/MIME Sign Message"),
                 self::SMIME_SIGNENC => _("S/MIME Sign/Encrypt Message")
-            ));
+            );
         }
 
-        $enc_opts = array_merge(array(self::ENCRYPT_NONE => _("No Encryption")), $enc_opts);
-
         foreach ($enc_opts as $key => $val) {
              $output .= '<option value="' . $key . '"' . (($default == $key) ? ' selected="selected"' : '') . '>' . $val . '</option>' . "\n";
         }