ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
26  throw new ilMailException($a_addresses);
27  }
28 
29  require_once 'Services/Mail/classes/Address/class.ilMailAddress.php';
30  return array_map(function($address) {
31  return new ilMailAddress($address->mailbox, $address->host);
32  }, $valid_parsed_addresses);
33  }
const ILIAS_HOST
Class ilMailException.
Class ilMailAddress.

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