ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMailImapRfc822AddressParser.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
27  protected function parseAddressString(string $addresses): array
28  {
29  $parsedAddresses = imap_rfc822_parse_adrlist($addresses, $this->installationHost);
30 
31  // #18992
32  $validParsedAddresses = array_filter($parsedAddresses, static function (stdClass $address): bool {
33  return '.SYNTAX-ERROR.' !== $address->host;
34  });
35 
36  if ($parsedAddresses !== $validParsedAddresses) {
37  throw new ilMailException($addresses);
38  }
39 
40  return array_map(static function (stdClass $address): ilMailAddress {
41  return new ilMailAddress($address->mailbox, $address->host);
42  }, $validParsedAddresses);
43  }
44 }
Class ilBaseMailRfc822AddressParser.
Class ilMailImapRfc822AddressParser.
Class ilMailAddress.