/** * Redefine the encoding requirements for mailboxes. * * Commas and semicolons are used to separate * multiple addresses, and should therefore be encoded * * @param string $token * * @return bool */ protected function tokenNeedsEncoding($token) { return preg_match('/[,;]/', $token) || parent::tokenNeedsEncoding($token); }
/** * Redefine the encoding requirements for mailboxes. * * All "specials" must be encoded as the full header value will not be quoted * * @see RFC 2822 3.2.1 * * @param string $token * * @return bool */ protected function tokenNeedsEncoding($token) { return preg_match('/[()<>\\[\\]:;@\\,."]/', $token) || parent::tokenNeedsEncoding($token); }