ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMailImapRfc822AddressParser.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
9 {
13  protected function parseAddressString(string $a_addresses) : array
14  {
15  $parsed_addresses = imap_rfc822_parse_adrlist($a_addresses, $this->installationHost);
16 
17  // #18992
18  $valid_parsed_addresses = array_filter($parsed_addresses, function ($address) {
19  return '.SYNTAX-ERROR.' != $address->host;
20  });
21 
22  if ($parsed_addresses != $valid_parsed_addresses) {
23  throw new \ilMailException($a_addresses);
24  }
25 
26  return array_map(function ($address) {
27  return new \ilMailAddress($address->mailbox, $address->host);
28  }, $valid_parsed_addresses);
29  }
30 }
Class ilBaseMailRfc822AddressParser.
Class ilMailImapRfc822AddressParser.