diff options
Diffstat (limited to 'lib/Address.php')
-rw-r--r-- | lib/Address.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Address.php b/lib/Address.php index a8ea774cd..cfa96169a 100644 --- a/lib/Address.php +++ b/lib/Address.php @@ -79,7 +79,11 @@ class Address implements JsonSerializable { return null; } // Lets make sure the e-mail is valid UTF-8 at all times - return iconv("UTF-8","UTF-8//IGNORE", $email); + $utf8 = iconv("UTF-8", "UTF-8//IGNORE", $email); + if ($utf8 === false) { + throw new \Exception("Email address <$email> could not be converted via iconv"); + } + return $utf8; } /** |