From 270b23a21135cfa24da90f1426e9b1e40b375db3 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 19 May 2009 12:59:08 -0600 Subject: [PATCH] Improvements in handling invalid characters in e-mail address --- imp/compose-dimp.php | 2 +- imp/lib/Compose.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index 8639763e4..a51d76464 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -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; diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index f3451198e..191f2c8d8 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -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)); } -- 2.11.0