EC-CUBE
Public メソッド | 変数
クラス Mail_RFC822

Public メソッド

 Mail_RFC822 ($address=null, $default_domain=null, $nest_groups=null, $validate=null, $limit=null)
 parseAddressList ($address=null, $default_domain=null, $nest_groups=null, $validate=null, $limit=null)
 _splitAddresses ($address)
 _isGroup ($address)
 _splitCheck ($parts, $char)
 _hasUnclosedQuotes ($string)
 _hasUnclosedBrackets ($string, $chars)
 _hasUnclosedBracketsSub ($string, &$num, $char)
 _validateAddress ($address)
 _validatePhrase ($phrase)
 _validateAtom ($atom)
 _validateQuotedString ($qstring)
 validateMailbox (&$mailbox)
 _validateRouteAddr ($route_addr)
 _validateRoute ($route)
 _validateDomain ($domain)
 _validateSubdomain ($subdomain)
 _validateDliteral ($dliteral)
 _validateAddrSpec ($addr_spec)
 _validateLocalPart ($local_part)
 approximateCount ($data)
 isValidInetAddress ($data, $strict=false)

変数

 $address = ''
 $default_domain = 'localhost'
 $nestGroups = true
 $validate = true
 $addresses = array()
 $structure = array()
 $error = null
 $index = null
 $num_groups = 0
 $mailRFC822 = true
 $limit = null

関数

_hasUnclosedBrackets ( string,
chars 
)

Checks if a string has an unclosed brackets or not. IMPORTANT: This function handles both angle brackets and square brackets;

private

引数:
string$stringThe string to check.
string$charsThe characters to check for.
戻り値:
boolean True if there are unclosed brackets inside the string, false otherwise.
_hasUnclosedBracketsSub ( string,
&$  num,
char 
)

Sub function that is used only by hasUnclosedBrackets().

private

引数:
string$stringThe string to check.
integer&$numThe number of occurences.
string$charThe character to count.
戻り値:
integer The number of occurences of $char in $string, adjusted for backslashes.
_hasUnclosedQuotes ( string)

Checks if a string has unclosed quotes or not.

private

引数:
string$stringThe string to check.
戻り値:
boolean True if there are unclosed quotes inside the string, false otherwise.
_isGroup ( address)

Checks for a group at the start of the string.

private

引数:
string$addressThe address to check.
戻り値:
boolean Whether or not there is a group at the start of the string.
_splitAddresses ( address)

Splits an address into separate addresses.

private

引数:
string$addressThe addresses to split.
戻り値:
boolean Success or failure.
_splitCheck ( parts,
char 
)

A common function that will check an exploded string.

private

引数:
array$partsThe exloded string.
string$charThe char that was exploded on.
戻り値:
mixed False if the string contains unclosed quotes/brackets, or the string on success.
_validateAddress ( address)

Function to begin checking the address.

private

引数:
string$addressThe address to validate.
戻り値:
mixed False on failure, or a structured array of address information on success.
_validateAddrSpec ( addr_spec)

Function to validate an addr-spec.

addr-spec = local-part "@" domain

private

引数:
string$addr_specThe string to check.
戻り値:
mixed False on failure, or the validated addr-spec on success.
_validateAtom ( atom)

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.

private

引数:
string$atomThe string to check.
戻り値:
boolean Success or failure.
_validateDliteral ( dliteral)

Function to validate a domain literal: domain-literal = "[" *(dtext / quoted-pair) "]"

private

引数:
string$dliteralThe string to check.
戻り値:
boolean Success or failure.
_validateDomain ( domain)

Function to validate a domain, though this is not quite what you expect of a strict internet domain.

domain = sub-domain *("." sub-domain)

private

引数:
string$domainThe string to check.
戻り値:
mixed False on failure, or the validated domain on success.
_validateLocalPart ( local_part)

Function to validate the local part of an address: local-part = word *("." word)

private

引数:
string$local_part
戻り値:
mixed False on failure, or the validated local part on success.
_validatePhrase ( phrase)

Function to validate a phrase.

private

引数:
string$phraseThe phrase to check.
戻り値:
boolean Success or failure.
_validateQuotedString ( qstring)

Function to validate quoted string, which is: quoted-string = <"> *(qtext/quoted-pair) <">

private

引数:
string$qstringThe string to check
戻り値:
boolean Success or failure.
_validateRoute ( route)

Function to validate a route, which is: route = 1#("@" domain) ":"

private

引数:
string$routeThe string to check.
戻り値:
mixed False on failure, or the validated $route on success.
_validateRouteAddr ( route_addr)

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.

private

引数:
string$route_addrThe string to check.
戻り値:
mixed False on failure, or an array containing validated address/route information on success.
_validateSubdomain ( subdomain)

Function to validate a subdomain: subdomain = domain-ref / domain-literal

private

引数:
string$subdomainThe string to check.
戻り値:
boolean Success or failure.
approximateCount ( 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$dataAddresses to count
戻り値:
int Approximate count
isValidInetAddress ( data,
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$dataAddress to check
boolean$strictOptional stricter mode
戻り値:
mixed False if it fails, an indexed array username/domain if it matches
Mail_RFC822 ( address = null,
default_domain = null,
nest_groups = null,
validate = null,
limit = null 
)

Sets up the object. The address must either be set here or when calling parseAddressList(). One or the other.

public

引数:
string$addressThe address(es) to validate.
string$default_domainDefault domain/host etc. If not supplied, will be set to localhost.
boolean$nest_groupsWhether to return the structure with groups nested for easier viewing.
boolean$validateWhether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance.
戻り値:
object Mail_RFC822 A new Mail_RFC822 object.
parseAddressList ( address = null,
default_domain = null,
nest_groups = null,
validate = null,
limit = null 
)

Starts the whole process. The address must either be set here or when creating the object. One or the other.

public

引数:
string$addressThe address(es) to validate.
string$default_domainDefault domain/host etc.
boolean$nest_groupsWhether to return the structure with groups nested for easier viewing.
boolean$validateWhether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance.
戻り値:
array A structured array of addresses.
validateMailbox ( &$  mailbox)

Function to validate a mailbox, which is: mailbox = addr-spec ; simple address / phrase route-addr ; name and route-addr

public

引数:
string&$mailboxThe string to check.
戻り値:
boolean Success or failure.

構造体

string $address = ''

The address being parsed by the RFC822 object.

array $addresses = array()

The array of raw addresses built up as we parse.

string $default_domain = 'localhost'

The default domain to use for unqualified addresses.

string $error = null

The current error message, if any.

integer $index = null

An internal counter/pointer.

int $limit = null

A limit after which processing stops

boolean $mailRFC822 = true

A variable so that we can tell whether or not we're inside a Mail_RFC822 object.

boolean $nestGroups = true

Should we return a nested array showing groups, or flatten everything?

integer $num_groups = 0

The number of groups that have been found in the address list.

public

array $structure = array()

The final array of parsed address information that we build up.

boolean $validate = true

Whether or not to validate atoms for non-ascii characters.


このクラスの説明は次のファイルから生成されました:
 全て データ構造 ネームスペース 関数 変数