|
ILIAS
release_8 Revision v8.24
|
Collaboration diagram for Mail_RFC822:Public Member Functions | |
| __construct (string $address=null, string $default_domain=null, bool $nest_groups=null, bool $validate=null, int $limit=null) | |
| Sets up the object. More... | |
| parseAddressList (string $address=null, string $default_domain=null, bool $nest_groups=null, bool $validate=null, int $limit=null) | |
| Starts the whole process. More... | |
| validateMailbox (string &$mailbox) | |
| Function to validate a mailbox, which is: mailbox = addr-spec ; simple address / phrase route-addr ; name and route-addr. More... | |
| approximateCount (string $data) | |
| Returns an approximate count of how many addresses are in the given string. More... | |
| isValidInetAddress (string $data, bool $strict=false) | |
| This is a email validating function separate to the rest of the class. More... | |
Data Fields | |
| string | $address = '' |
| The address being parsed by the RFC822 object. More... | |
| string | $default_domain = 'localhost' |
| The default domain to use for unqualified addresses. More... | |
| bool | $nestGroups = true |
| Should we return a nested array showing groups, or flatten everything? More... | |
| bool | $validate = true |
| Whether or not to validate atoms for non-ascii characters. More... | |
| array | $addresses = [] |
| The array of raw addresses built up as we parse. More... | |
| array | $structure = [] |
| The final array of parsed address information that we build up. More... | |
| string | $error = null |
| The current error message, if any. More... | |
| int | $index = null |
| An internal counter/pointer. More... | |
| int | $num_groups = 0 |
| The number of groups that have been found in the address list. More... | |
| bool | $mailRFC822 = true |
| A variable so that we can tell whether or not we're inside a Mail_RFC822 object. More... | |
| int | $limit = null |
| A limit after which processing stops. More... | |
Protected Member Functions | |
| _splitAddresses (string $address) | |
| Splits an address into separate addresses. More... | |
| _isGroup (string $address) | |
| Checks for a group at the start of the string. More... | |
| _splitCheck (array $parts, string $char) | |
| A common function that will check an exploded string. More... | |
| _hasUnclosedQuotes (string $string) | |
| Checks if a string has unclosed quotes or not. More... | |
| _hasUnclosedBrackets (string $string, string $chars) | |
| Checks if a string has an unclosed brackets or not. More... | |
| _hasUnclosedBracketsSub (string $string, int &$num, string $char) | |
| Sub function that is used only by hasUnclosedBrackets(). More... | |
| _validateAddress (array $address) | |
| Function to begin checking the address. More... | |
| _validatePhrase (string $phrase) | |
| Function to validate a phrase. More... | |
| _validateAtom (string $atom) | |
| Function to validate an atom which from rfc822 is: atom = 1*<any CHAR except specials, SPACE and CTLs> More... | |
| _validateQuotedString (string $qstring) | |
| Function to validate quoted string, which is: quoted-string = <"> *(qtext/quoted-pair) <"> More... | |
| _validateRouteAddr (string $route_addr) | |
| This function validates a route-addr which is: route-addr = "<" [route] addr-spec ">". More... | |
| _validateRoute (string $route) | |
| Function to validate a route, which is: route = 1#("@" domain) ":". More... | |
| _validateDomain (string $domain) | |
| Function to validate a domain, though this is not quite what you expect of a strict internet domain. More... | |
| _validateSubdomain (string $subdomain) | |
| Function to validate a subdomain: subdomain = domain-ref / domain-literal. More... | |
| _validateDliteral (string $dliteral) | |
| Function to validate a domain literal: domain-literal = "[" *(dtext / quoted-pair) "]". More... | |
| _validateAddrSpec (string $addr_spec) | |
| Function to validate an addr-spec. More... | |
| _validateLocalPart (string $local_part) | |
| Function to validate the local part of an address: local-part = word *("." word) More... | |
Definition at line 91 of file RFC822.php.
| Mail_RFC822::__construct | ( | string | $address = null, |
| string | $default_domain = null, |
||
| bool | $nest_groups = null, |
||
| bool | $validate = null, |
||
| int | $limit = null |
||
| ) |
Sets up the object.
The address must either be set here or when calling parseAddressList(). One or the other.
| string | $address | The address(es) to validate. |
| string | $default_domain | Default domain/host etc. If not supplied, will be set to localhost. |
| bool | $nest_groups | Whether to return the structure with groups nested for easier viewing. |
| bool | $validate | Whether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance. |
Definition at line 171 of file RFC822.php.
References $address, $default_domain, $limit, and $validate.
|
protected |
Checks if a string has an unclosed brackets or not.
IMPORTANT: This function handles both angle brackets and square brackets;
| string | $string | The string to check. |
| string | $chars | The characters to check for. |
Definition at line 441 of file RFC822.php.
References error().
Here is the call graph for this function:
|
protected |
Sub function that is used only by hasUnclosedBrackets().
| string | $string | The string to check. |
| int | &$num | The number of occurences. |
| string | $char | The character to count. |
Definition at line 465 of file RFC822.php.
|
protected |
Checks if a string has unclosed quotes or not.
| string | $string | The string to check. |
Definition at line 404 of file RFC822.php.
References $i.
|
protected |
Checks for a group at the start of the string.
| string | $address | The address to check. |
Definition at line 349 of file RFC822.php.
References $parts.
|
protected |
Splits an address into separate addresses.
| string | $address | The addresses to split. |
Definition at line 281 of file RFC822.php.
References $parts, and error().
Here is the call graph for this function:
|
protected |
A common function that will check an exploded string.
| array | $parts | The exloded string. |
| string | $char | The char that was exploded on. |
Definition at line 373 of file RFC822.php.
References $i, $parts, and error().
Here is the call graph for this function:
|
protected |
Function to begin checking the address.
| array | $address | The address to validate. |
Definition at line 486 of file RFC822.php.
References $i, $parts, and error().
Here is the call graph for this function:
|
protected |
Function to validate an addr-spec.
addr-spec = local-part "@" domain
| string | $addr_spec | The string to check. |
Definition at line 892 of file RFC822.php.
References $parts.
|
protected |
Function to validate an atom which from rfc822 is: atom = 1*<any CHAR except specials, SPACE and CTLs>
If validation ($this->validate) has been turned off, then validateAtom() doesn't actually check anything. This is so that you can split a list of addresses up before encoding personal names (umlauts, etc.), for example.
| string | $atom | The string to check. |
Definition at line 611 of file RFC822.php.
|
protected |
Function to validate a domain literal: domain-literal = "[" *(dtext / quoted-pair) "]".
| string | $dliteral | The string to check. |
Definition at line 878 of file RFC822.php.
|
protected |
Function to validate a domain, though this is not quite what you expect of a strict internet domain.
domain = sub-domain *("." sub-domain)
| string | $domain | The string to check. |
Definition at line 827 of file RFC822.php.
References $i.
|
protected |
Function to validate the local part of an address: local-part = word *("." word)
@access private
| string | $local_part |
Definition at line 941 of file RFC822.php.
|
protected |
Function to validate a phrase.
| string | $phrase | The phrase to check. |
Definition at line 568 of file RFC822.php.
|
protected |
Function to validate quoted string, which is: quoted-string = <"> *(qtext/quoted-pair) <">
| string | $qstring | The string to check |
Definition at line 646 of file RFC822.php.
|
protected |
Function to validate a route, which is: route = 1#("@" domain) ":".
| string | $route | The string to check. |
Definition at line 803 of file RFC822.php.
|
protected |
This function validates a route-addr which is: route-addr = "<" [route] addr-spec ">".
Angle brackets have already been removed at the point of getting to this function.
| string | $route_addr | The string to check. |
Definition at line 754 of file RFC822.php.
References $parts.
|
protected |
Function to validate a subdomain: subdomain = domain-ref / domain-literal.
| string | $subdomain | The string to check. |
Definition at line 857 of file RFC822.php.
| Mail_RFC822::approximateCount | ( | string | $data | ) |
Returns an approximate count of how many addresses are in the given string.
This is APPROXIMATE as it only splits based on a comma which has no preceding backslash. Could be useful as large amounts of addresses will end up producing large structures when used with parseAddressList().
| string | $data | Addresses to count |
Definition at line 990 of file RFC822.php.
References $data.
| Mail_RFC822::isValidInetAddress | ( | string | $data, |
| bool | $strict = false |
||
| ) |
This is a email validating function separate to the rest of the class.
It simply validates whether an email is of the common internet form: <user><domain>. This can be sufficient for most people. Optional stricter mode can be utilised which restricts mailbox characters allowed to alphanumeric, full stop, hyphen and underscore.
| string | $data | Address to check |
| bool | $strict | Optional stricter mode |
Definition at line 1008 of file RFC822.php.
References $data.
| Mail_RFC822::parseAddressList | ( | string | $address = null, |
| string | $default_domain = null, |
||
| bool | $nest_groups = null, |
||
| bool | $validate = null, |
||
| int | $limit = null |
||
| ) |
Starts the whole process.
The address must either be set here or when creating the object. One or the other.
| string | $address | The address(es) to validate. |
| string | $default_domain | Default domain/host etc. |
| bool | $nest_groups | Whether to return the structure with groups nested for easier viewing. |
| bool | $validate | Whether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance. |
Definition at line 206 of file RFC822.php.
References $address, $default_domain, $limit, and $validate.
| Mail_RFC822::validateMailbox | ( | string & | $mailbox | ) |
Function to validate a mailbox, which is: mailbox = addr-spec ; simple address / phrase route-addr ; name and route-addr.
| string | &$mailbox | The string to check. |
Definition at line 663 of file RFC822.php.
| string Mail_RFC822::$address = '' |
The address being parsed by the RFC822 object.
Definition at line 97 of file RFC822.php.
Referenced by __construct(), and parseAddressList().
| array Mail_RFC822::$addresses = [] |
The array of raw addresses built up as we parse.
Definition at line 121 of file RFC822.php.
| string Mail_RFC822::$default_domain = 'localhost' |
The default domain to use for unqualified addresses.
Definition at line 103 of file RFC822.php.
Referenced by __construct(), and parseAddressList().
| string Mail_RFC822::$error = null |
The current error message, if any.
Definition at line 133 of file RFC822.php.
| int Mail_RFC822::$index = null |
An internal counter/pointer.
Definition at line 139 of file RFC822.php.
| int Mail_RFC822::$limit = null |
A limit after which processing stops.
Definition at line 159 of file RFC822.php.
Referenced by __construct(), and parseAddressList().
| bool Mail_RFC822::$mailRFC822 = true |
A variable so that we can tell whether or not we're inside a Mail_RFC822 object.
Definition at line 153 of file RFC822.php.
| bool Mail_RFC822::$nestGroups = true |
Should we return a nested array showing groups, or flatten everything?
Definition at line 109 of file RFC822.php.
| int Mail_RFC822::$num_groups = 0 |
The number of groups that have been found in the address list.
@access public
Definition at line 146 of file RFC822.php.
| array Mail_RFC822::$structure = [] |
The final array of parsed address information that we build up.
Definition at line 127 of file RFC822.php.
| bool Mail_RFC822::$validate = true |
Whether or not to validate atoms for non-ascii characters.
Definition at line 115 of file RFC822.php.
Referenced by __construct(), and parseAddressList().