|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| __construct ($options=array()) | |
| getOptions () | |
| setOptions ($options) | |
| getIpValidator () | |
| setIpValidator (Zend_Validate_Ip $ipValidator=null) | |
| getAllow () | |
| setAllow ($allow) | |
| getValidateIdn () | |
| setValidateIdn ($allowed) | |
| getValidateTld () | |
| setValidateTld ($allowed) | |
| isValid ($value) | |
Data Fields | |
| const | INVALID = 'hostnameInvalid' |
| const | IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed' |
| const | UNKNOWN_TLD = 'hostnameUnknownTld' |
| const | INVALID_DASH = 'hostnameDashCharacter' |
| const | INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema' |
| const | UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld' |
| const | INVALID_HOSTNAME = 'hostnameInvalidHostname' |
| const | INVALID_LOCAL_NAME = 'hostnameInvalidLocalName' |
| const | LOCAL_NAME_NOT_ALLOWED = 'hostnameLocalNameNotAllowed' |
| const | CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode' |
| const | ALLOW_DNS = 1 |
| const | ALLOW_IP = 2 |
| const | ALLOW_LOCAL = 4 |
| const | ALLOW_ALL = 7 |
Protected Member Functions | |
| decodePunycode ($encoded) | |
Protected Attributes | |
| $_messageTemplates | |
| $_messageVariables | |
| $_validTlds | |
| $_tld | |
| $_validIdns | |
| $_idnLength | |
| $_options | |
Definition at line 47 of file Hostname.php.
| __construct | ( | $ | options = array() | ) |
Sets validator options
| integer | $allow | OPTIONAL Set what types of hostname to allow (default ALLOW_DNS) |
| boolean | $validateIdn | OPTIONAL Set whether IDN domains are validated (default true) |
| boolean | $validateTld | OPTIONAL Set whether the TLD element of a hostname is validated (default true) |
| Zend_Validate_Ip | $ipValidator | OPTIONAL |
Definition at line 325 of file Hostname.php.

| decodePunycode | ( | $ | encoded | ) | [protected] |
Decodes a punycode encoded string to it's original utf8 string In case of a decoding failure the original string is returned
| string | $encoded | Punycode encoded string to decode |
Definition at line 651 of file Hostname.php.


| getAllow | ( | ) |
| getIpValidator | ( | ) |
| getOptions | ( | ) |
| getValidateIdn | ( | ) |
| getValidateTld | ( | ) |
| isValid | ( | $ | value | ) |
Defined by Zend_Validate_Interface
Returns true if and only if the $value is a valid hostname with respect to the current allow option
| string | $value |
| Zend_Validate_Exception | if a fatal error occurs for validation process |
Match against IDN hostnames Note: Keep label regex short to avoid issues with long patterns when matching IDN hostnames
Implements Zend_Validate_Interface.
Definition at line 489 of file Hostname.php.

| setAllow | ( | $ | allow | ) |
Sets the allow option
| integer | $allow |
Definition at line 428 of file Hostname.php.

| setIpValidator | ( | Zend_Validate_Ip $ | ipValidator = null | ) |
| Zend_Validate_Ip | $ipValidator | OPTIONAL |
Definition at line 402 of file Hostname.php.

| setOptions | ( | $ | options | ) |
Sets the options for this validator
| array | $options |
Definition at line 367 of file Hostname.php.


| setValidateIdn | ( | $ | allowed | ) |
Set whether IDN domains are validated
This only applies when DNS hostnames are validated
| boolean | $allowed | Set allowed to true to validate IDNs, and false to not validate them |
Definition at line 451 of file Hostname.php.

| setValidateTld | ( | $ | allowed | ) |
Set whether the TLD element of a hostname is validated
This only applies when DNS hostnames are validated
| boolean | $allowed | Set allowed to true to validate TLDs, and false to not validate them |
Definition at line 474 of file Hostname.php.

$_idnLength [protected] |
array( 'BIZ' => array(5 => 17, 11 => 15, 12 => 20), 'CN' => array(1 => 20), 'COM' => array(3 => 17, 5 => 20), 'HK' => array(1 => 15), 'INFO'=> array(4 => 17), 'KR' => array(1 => 17), 'NET' => array(3 => 17, 5 => 20), 'ORG' => array(6 => 17), 'TW' => array(1 => 20), 'ایران' => array(1 => 30), '中国' => array(1 => 20), '公司' => array(1 => 20), '网络' => array(1 => 20), )
Definition at line 292 of file Hostname.php.
$_messageTemplates [protected] |
array( self::INVALID => "Invalid type given, value should be a string", self::IP_ADDRESS_NOT_ALLOWED => "'%value%' appears to be an IP address, but IP addresses are not allowed", self::UNKNOWN_TLD => "'%value%' appears to be a DNS hostname but cannot match TLD against known list", self::INVALID_DASH => "'%value%' appears to be a DNS hostname but contains a dash in an invalid position", self::INVALID_HOSTNAME_SCHEMA => "'%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'", self::UNDECIPHERABLE_TLD => "'%value%' appears to be a DNS hostname but cannot extract TLD part", self::INVALID_HOSTNAME => "'%value%' does not match the expected structure for a DNS hostname", self::INVALID_LOCAL_NAME => "'%value%' does not appear to be a valid local network name", self::LOCAL_NAME_NOT_ALLOWED => "'%value%' appears to be a local network name but local network names are not allowed", self::CANNOT_DECODE_PUNYCODE => "'%value%' appears to be a DNS hostname but the given punycode notation cannot be decoded", )
Reimplemented from Zend_Validate_Abstract.
Definition at line 63 of file Hostname.php.
$_messageVariables [protected] |
array( 'tld' => '_tld' )
Reimplemented from Zend_Validate_Abstract.
Definition at line 79 of file Hostname.php.
$_options [protected] |
array( 'allow' => self::ALLOW_DNS, 'idn' => true, 'tld' => true, 'ip' => null )
Definition at line 308 of file Hostname.php.
$_tld [protected] |
Definition at line 135 of file Hostname.php.
$_validIdns [protected] |
Definition at line 187 of file Hostname.php.
$_validTlds [protected] |
array( 'ac', 'ad', 'ae', 'aero', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'aq', 'ar', 'arpa', 'as', 'asia', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', 'biz', 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', 'cat', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', 'co', 'com', 'coop', 'cr', 'cu', 'cv', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'edu', 'ee', 'eg', 'er', 'es', 'et', 'eu', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', 'gb', 'gd', 'ge', 'gf', 'gg', 'gh', 'gi', 'gl', 'gm', 'gn', 'gov', 'gp', 'gq', 'gr', 'gs', 'gt', 'gu', 'gw', 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', 'ie', 'il', 'im', 'in', 'info', 'int', 'io', 'iq', 'ir', 'is', 'it', 'je', 'jm', 'jo', 'jobs', 'jp', 'ke', 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', 'lc', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', 'me', 'mg', 'mh', 'mil', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'museum', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'name', 'nc', 'ne', 'net', 'nf', 'ng', 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'org', 'pa', 'pe', 'pf', 'pg', 'ph', 'pk', 'pl', 'pm', 'pn', 'pr', 'pro', 'ps', 'pt', 'pw', 'py', 'qa', 're', 'ro', 'rs', 'ru', 'rw', 'sa', 'sb', 'sc', 'sd', 'se', 'sg', 'sh', 'si', 'sj', 'sk', 'sl', 'sm', 'sn', 'so', 'sr', 'st', 'su', 'sv', 'sy', 'sz', 'tc', 'td', 'tel', 'tf', 'tg', 'th', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'tp', 'tr', 'travel', 'tt', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'um', 'us', 'uy', 'uz', 'va', 'vc', 've', 'vg', 'vi', 'vn', 'vu', 'wf', 'ws', 'ye', 'yt', 'yu', 'za', 'zm', 'zw' )
Definition at line 110 of file Hostname.php.
| const ALLOW_ALL = 7 |
Allows all types of hostnames
Definition at line 101 of file Hostname.php.
| const ALLOW_DNS = 1 |
Allows Internet domain names (e.g., example.com)
Definition at line 86 of file Hostname.php.
| const ALLOW_IP = 2 |
Allows IP addresses
Definition at line 91 of file Hostname.php.
| const ALLOW_LOCAL = 4 |
Allows local network names (e.g., localhost, www.localdomain)
Definition at line 96 of file Hostname.php.
| const CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode' |
Definition at line 58 of file Hostname.php.
| const INVALID = 'hostnameInvalid' |
Definition at line 49 of file Hostname.php.
| const INVALID_DASH = 'hostnameDashCharacter' |
Definition at line 52 of file Hostname.php.
| const INVALID_HOSTNAME = 'hostnameInvalidHostname' |
Definition at line 55 of file Hostname.php.
| const INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema' |
Definition at line 53 of file Hostname.php.
| const INVALID_LOCAL_NAME = 'hostnameInvalidLocalName' |
Definition at line 56 of file Hostname.php.
| const IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed' |
Definition at line 50 of file Hostname.php.
| const LOCAL_NAME_NOT_ALLOWED = 'hostnameLocalNameNotAllowed' |
Definition at line 57 of file Hostname.php.
| const UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld' |
Definition at line 54 of file Hostname.php.
| const UNKNOWN_TLD = 'hostnameUnknownTld' |
Definition at line 51 of file Hostname.php.