Skip to main content
Sign in
Snippets Groups Projects
Unverified Commit 13f71781 authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #4099 from nextcloud/enhancement/catch-iconv-return-false

Catch when iconv returns false
parents 7bb45384 7dac7d7a
Branches
Tags
No related merge requests found
......@@ -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;
}
/**
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment