Improvements in handling invalid characters in e-mail address
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 19 May 2009 18:59:08 +0000 (12:59 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 19 May 2009 19:05:43 +0000 (13:05 -0600)
imp/compose-dimp.php
imp/lib/Compose.php

index 8639763..a51d764 100644 (file)
@@ -163,7 +163,7 @@ if (count($_POST)) {
         try {
             $sent = $imp_compose->buildAndSendMessage($message, $header, $charset, $html, $options);
         } catch (IMP_Compose_Exception $e) {
-            $notification->push($e, 'horde.error');
+            $notification->push($e->getMessage(), 'horde.error');
             break;
         }
         $result->success = true;
index f345119..191f2c8 100644 (file)
@@ -872,10 +872,6 @@ class IMP_Compose
      */
     protected function _parseAddress($ob, $email)
     {
-        if (Horde_Mime::is8bit($ob['mailbox'])) {
-            throw new IMP_Compose_Exception(sprintf(_("Invalid character in e-mail address: %s."), $email));
-        }
-
         // Make sure we have a valid host.
         $host = trim($ob['host']);
         if (empty($host)) {
@@ -884,7 +880,9 @@ class IMP_Compose
 
         // Convert IDN hosts to ASCII.
         if (Util::extensionExists('idn')) {
+            $old_error = error_reporting(0);
             $host = idn_to_ascii(String::convertCharset($host, NLS::getCharset(), 'UTF-8'));
+            error_reporting($old_error);
         } elseif (Horde_Mime::is8bit($ob['mailbox'])) {
             throw new IMP_Compose_Exception(sprintf(_("Invalid character in e-mail address: %s."), $email));
         }