diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2020-10-20 22:27:09 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2020-10-20 22:27:09 +0300 |
commit | 4a9ad43c5351c39944dd3e1668b0a2f0c56bf580 (patch) | |
tree | 71aa17add33245b0266525f5f0e02de6e20fdae3 /lib/Address.php | |
parent | dbc52c971641b74e57c705c727fef125ffb0abe0 (diff) |
Make sure the e-mail is valid UTF-8
Sometimes (I'm looking at you SPAM mails) the e-mail address will
contain invalid UTF-8. This will make sure we only return valid UTF-8 by
just stripping the invalid parts.
Hacky: for sure
Works: for me
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/Address.php')
-rw-r--r-- | lib/Address.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Address.php b/lib/Address.php index 8f82c8b32..98f9f11cd 100644 --- a/lib/Address.php +++ b/lib/Address.php @@ -74,7 +74,8 @@ class Address implements JsonSerializable { * @return string|null */ public function getEmail(): ?string { - return $this->wrapped->bare_address; + // Lets make sure the e-mail is valid UTF-8 at all times + return iconv("UTF-8","UTF-8//IGNORE", $this->wrapped->bare_address); } /** |