ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMailImapRfc822AddressParser Class Reference

Class ilImapMailRfc822AddressParser. More...

+ Inheritance diagram for ilMailImapRfc822AddressParser:
+ Collaboration diagram for ilMailImapRfc822AddressParser:

Protected Member Functions

 parseAddressString ($a_addresses)
 {} More...
 
- Protected Member Functions inherited from ilBaseMailRfc822AddressParser
 parseAddressString ($a_addresses)
 

Additional Inherited Members

- Public Member Functions inherited from ilBaseMailRfc822AddressParser
 __construct ($a_addresses)
 
 getAddresses ()
 
 setAddresses ($addresses)
 
 parse ()
 {
Returns
ilMailAddress[]
} More...
 
- Protected Attributes inherited from ilBaseMailRfc822AddressParser
 $addresses = ''
 

Detailed Description

Class ilImapMailRfc822AddressParser.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 10 of file class.ilMailImapRfc822AddressParser.php.

Member Function Documentation

◆ parseAddressString()

ilMailImapRfc822AddressParser::parseAddressString (   $a_addresses)
protected

{}

Definition at line 15 of file class.ilMailImapRfc822AddressParser.php.

References ilMail\ILIAS_HOST.

16  {
17  require_once 'Services/Mail/classes/class.ilMail.php';
18  $parsed_addresses = imap_rfc822_parse_adrlist($a_addresses, ilMail::ILIAS_HOST);
19 
20  // #18992
21  $valid_parsed_addresses = array_filter($parsed_addresses, function ($address) {
22  return '.SYNTAX-ERROR.' != $address->host;
23  });
24  if ($parsed_addresses != $valid_parsed_addresses) {
25  throw new ilMailException($a_addresses);
26  }
27 
28  require_once 'Services/Mail/classes/Address/class.ilMailAddress.php';
29  return array_map(function ($address) {
30  return new ilMailAddress($address->mailbox, $address->host);
31  }, $valid_parsed_addresses);
32  }
const ILIAS_HOST
Class ilMailException.
Class ilMailAddress.

The documentation for this class was generated from the following file: