Whitespace around the name is going to be a little wonky and this is in
preparation of a future change that detects and suppresses empty names.
use TrueBV\Punycode;
use wcf\data\language\Language;
use wcf\system\language\LanguageFactory;
+use wcf\util\StringUtil;
/**
* Represents a RFC 5322 mailbox.
public function __construct($address, $name = null, ?Language $language = null)
{
$this->address = self::filterAddress($address);
- $this->name = $name;
+ $this->name = $name !== null ? StringUtil::trim($name) : null;
if ($language === null) {
$this->languageID = LanguageFactory::getInstance()->getDefaultLanguageID();
} else {