## Zend_Validate_Hostname

Description

Please note there are two standalone test scripts for testing IDN characters due to problems with file encoding.

The first is tests/Zend/Validate/HostnameTestStandalone.php which is designed to be run on the command line.

The second is tests/Zend/Validate/HostnameTestForm.php which is designed to be run via HTML to allow users to test entering UTF-8 characters in a form.

- copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- license: New BSD License

Located in /Validate/Hostname.php (line 47)

    Zend_Validate_Abstract
       |
       --Zend_Validate_Hostname

Class Constant Summary
ALLOW_ALL = 7
ALLOW_DNS = 1
ALLOW_IP = 2
ALLOW_LOCAL = 4
ALLOW_URI = 8
CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode'
INVALID = 'hostnameInvalid'
INVALID_DASH = 'hostnameDashCharacter'
INVALID_HOSTNAME = 'hostnameInvalidHostname'
INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema'
INVALID_LOCAL_NAME = 'hostnameInvalidLocalName'
INVALID_URI = 'hostnameInvalidUri'
IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed'
LOCAL_NAME_NOT_ALLOWED = 'hostnameLocalNameNotAllowed'
UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld'
UNKNOWN_TLD = 'hostnameUnknownTld'
Variable Summary
mixed $_idnLength
array $_messageTemplates
array $_messageVariables
mixed $_options
string $_tld
array $_validIdns
array $_validTlds
Method Summary
string decodePunycode (string $encoded)
integer getAllow ()
Zend_Validate_Ip getIpValidator ()
array getOptions ()
boolean getValidateIdn ()
boolean getValidateTld ()
boolean isValid (string $value)
void __construct ([ $options = array()], integer $allow, boolean $validateIdn, boolean $validateTld, Zend_Validate_Ip $ipValidator)
Zend_Validate_Hostname setAllow (integer $allow)
void; setIpValidator ([Zend_Validate_Ip $ipValidator = null])
Zend_Validate_Hostname setOptions (array $options)
void setValidateIdn (boolean $allowed)
void setValidateTld (boolean $allowed)
Variables
mixed $_idnLength = 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),) (line 299)

- access: protected

array $_messageTemplates = array(
self::CANNOT_DECODE_PUNYCODE => "'%value%' appears to be a DNS hostname but the given punycode notation cannot be decoded",
self::INVALID => "Invalid type given. String expected",
self::INVALID_DASH => "'%value%' appears to be a DNS hostname but contains a dash in an invalid position",
self::INVALID_HOSTNAME => "'%value%' does not match the expected structure for a DNS hostname",
self::INVALID_HOSTNAME_SCHEMA => "'%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'",
self::INVALID_LOCAL_NAME => "'%value%' does not appear to be a valid local network name",
self::INVALID_URI => "'%value%' does not appear to be a valid URI hostname",
self::IP_ADDRESS_NOT_ALLOWED => "'%value%' appears to be an IP address, but IP addresses are not allowed",
self::LOCAL_NAME_NOT_ALLOWED => "'%value%' appears to be a local network name but local network names are not allowed",
self::UNDECIPHERABLE_TLD => "'%value%' appears to be a DNS hostname but cannot extract TLD part",
self::UNKNOWN_TLD => "'%value%' appears to be a DNS hostname but cannot match TLD against known list",
) (line 64)

- access: protected

Redefinition of:

Zend_Validate_Abstract::$_messageTemplates
  Validation failure message template definitions

array $_messageVariables = array(
'tld' => '_tld'
) (line 81)

- access: protected

Redefinition of:

Zend_Validate_Abstract::$_messageVariables
  Additional variables available for validation failure messages

mixed $_options = array(
'allow' => self::ALLOW_DNS,
'idn' => true,
'tld' => true,
'ip' => null
) (line 315)

- access: protected

string $_tld (line 142)

- access: protected

array $_validIdns = array(
'AC' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'),'AR'=>array(1=>'/^[\x{002d}0-9a-zà-ãç-êìíñ-õü]{1,63}$/iu'),'AS'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĸĺļľłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźż]{1,63}$/iu'),'AT'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿœšž]{1,63}$/iu'),'BIZ'=>'Hostname/Biz.php','BR'=>array(1=>'/^[\x{002d}0-9a-zà-ãçéíó-õúü]{1,63}$/iu'),'BV'=>array(1=>'/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),'CAT'=>array(1=>'/^[\x{002d}0-9a-z·àç-éíïòóúü]{1,63}$/iu'),'CH'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'),'CL'=>array(1=>'/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'),'CN'=>'Hostname/Cn.php','COM'=>'Zend/Validate/Hostname/Com.php','DE'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),'DK'=>array(1=>'/^[\x{002d}0-9a-zäéöü]{1,63}$/iu'),'ES'=>array(1=>'/^[\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'),'EU'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu',2=>'/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňŉŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu',3=>'/^[\x{002d}0-9a-zșț]{1,63}$/iu',4=>'/^[\x{002d}0-9a-zΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ]{1,63}$/iu',5=>'/^[\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюя]{1,63}$/iu',6=>'/^[\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu'),'FI'=>array(1=>'/^[\x{002d}0-9a-zäåö]{1,63}$/iu'),'GR'=>array(1=>'/^[\x{002d}0-9a-zΆΈΉΊΌΎ-ΡΣ-ώἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼῂῃῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲῳῴῶ-ῼ]{1,63}$/iu'),'HK'=>'Zend/Validate/Hostname/Cn.php','HU'=>array(1=>'/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu'),'INFO'=>array(1=>'/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu',2=>'/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',3=>'/^[\x{002d}0-9a-záæéíðóöúýþ]{1,63}$/iu',4=>'/^[\x{AC00}-\x{D7A3}]{1,17}$/iu',5=>'/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',6=>'/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',7=>'/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',8=>'/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'),'IO'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),'IS'=>array(1=>'/^[\x{002d}0-9a-záéýúíóþæöð]{1,63}$/iu'),'JP'=>'Zend/Validate/Hostname/Jp.php','KR'=>array(1=>'/^[\x{AC00}-\x{D7A3}]{1,17}$/iu'),'LI'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'),'LT'=>array(1=>'/^[\x{002d}0-9ąčęėįšųūž]{1,63}$/iu'),'MD'=>array(1=>'/^[\x{002d}0-9ăâîşţ]{1,63}$/iu'),'MUSEUM'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿāăąćċčďđēėęěğġģħīįıķĺļľłńņňŋōőœŕŗřśşšţťŧūůűųŵŷźżžǎǐǒǔ\x{01E5}\x{01E7}\x{01E9}\x{01EF}ə\x{0292}ẁẃẅỳ]{1,63}$/iu'),'NET'=>'Zend/Validate/Hostname/Com.php','NO'=>array(1=>'/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),'NU'=>'Zend/Validate/Hostname/Com.php','ORG'=>array(1=>'/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu',2=>'/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',3=>'/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu',4=>'/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',5=>'/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',6=>'/^[\x{AC00}-\x{D7A3}]{1,17}$/iu',7=>'/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu'),'PE'=>array(1=>'/^[\x{002d}0-9a-zñáéíóúü]{1,63}$/iu'),'PL'=>array(1=>'/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',2=>'/^[\x{002d}а-ик-ш\x{0450}ѓѕјљњќџ]{1,63}$/iu',3=>'/^[\x{002d}0-9a-zâîăşţ]{1,63}$/iu',4=>'/^[\x{002d}0-9а-яё\x{04C2}]{1,63}$/iu',5=>'/^[\x{002d}0-9a-zàáâèéêìíîòóôùúûċġħż]{1,63}$/iu',6=>'/^[\x{002d}0-9a-zàäåæéêòóôöøü]{1,63}$/iu',7=>'/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',8=>'/^[\x{002d}0-9a-zàáâãçéêíòóôõúü]{1,63}$/iu',9=>'/^[\x{002d}0-9a-zâîăşţ]{1,63}$/iu',10=>'/^[\x{002d}0-9a-záäéíóôúýčďĺľňŕšťž]{1,63}$/iu',11=>'/^[\x{002d}0-9a-zçë]{1,63}$/iu',12=>'/^[\x{002d}0-9а-ик-шђјљњћџ]{1,63}$/iu',13=>'/^[\x{002d}0-9a-zćčđšž]{1,63}$/iu',14=>'/^[\x{002d}0-9a-zâçöûüğış]{1,63}$/iu',15=>'/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu',16=>'/^[\x{002d}0-9a-zäõöüšž]{1,63}$/iu',17=>'/^[\x{002d}0-9a-zĉĝĥĵŝŭ]{1,63}$/iu',18=>'/^[\x{002d}0-9a-zâäéëîô]{1,63}$/iu',19=>'/^[\x{002d}0-9a-zàáâäåæçèéêëìíîïðñòôöøùúûüýćčłńřśš]{1,63}$/iu',20=>'/^[\x{002d}0-9a-zäåæõöøüšž]{1,63}$/iu',21=>'/^[\x{002d}0-9a-zàáçèéìíòóùú]{1,63}$/iu',22=>'/^[\x{002d}0-9a-zàáéíóöúüőű]{1,63}$/iu',23=>'/^[\x{002d}0-9ΐά-ώ]{1,63}$/iu',24=>'/^[\x{002d}0-9a-zàáâåæçèéêëðóôöøüþœ]{1,63}$/iu',25=>'/^[\x{002d}0-9a-záäéíóöúüýčďěňřšťůž]{1,63}$/iu',26=>'/^[\x{002d}0-9a-z·àçèéíïòóúü]{1,63}$/iu',27=>'/^[\x{002d}0-9а-ъьюя\x{0450}\x{045D}]{1,63}$/iu',28=>'/^[\x{002d}0-9а-яёіў]{1,63}$/iu',29=>'/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',30=>'/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu',31=>'/^[\x{002d}0-9a-zàâæçèéêëîïñôùûüÿœ]{1,63}$/iu',32=>'/^[\x{002d}0-9а-щъыьэюяёєіїґ]{1,63}$/iu',33=>'/^[\x{002d}0-9א-ת]{1,63}$/iu'),'PR'=>array(1=>'/^[\x{002d}0-9a-záéíóúñäëïüöâêîôûàèùæçœãõ]{1,63}$/iu'),'PT'=>array(1=>'/^[\x{002d}0-9a-záàâãçéêíóôõú]{1,63}$/iu'),'RU'=>array(1=>'/^[\x{002d}0-9а-яё]{1,63}$/iu'),'SA'=>array(1=>'/^[\x{002d}.0-9\x{0621}-\x{063A}\x{0641}-\x{064A}\x{0660}-\x{0669}]{1,63}$/iu'),'SE'=>array(1=>'/^[\x{002d}0-9a-zäåéöü]{1,63}$/iu'),'SH'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),'SJ'=>array(1=>'/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),'TH'=>array(1=>'/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'),'TM'=>array(1=>'/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'),'TW'=>'Zend/Validate/Hostname/Cn.php','TR'=>array(1=>'/^[\x{002d}0-9a-zğıüşöç]{1,63}$/iu'),'VE'=>array(1=>'/^[\x{002d}0-9a-záéíóúüñ]{1,63}$/iu'),'VN'=>array(1=>'/^[ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯư\x{1EA0}-\x{1EF9}]{1,63}$/iu'),'ایران'=>array(1=>'/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),'中国'=>'Zend/Validate/Hostname/Cn.php','公司'=>'Zend/Validate/Hostname/Cn.php','网络'=>'Zend/Validate/Hostname/Cn.php') (line 194)

Array for valid Idns

- see: http://www.iana.org/domains/idn-tables/ Official list of supported IDN Chars (.AC) Ascension Island http://www.nic.ac/pdf/AC-IDN-Policy.pdf (.AR) Argentinia http://www.nic.ar/faqidn.html (.AS) American Samoa http://www.nic.as/idn/chars.cfm (.AT) Austria http://www.nic.at/en/service/technical_information/idn/charset_converter/ (.BIZ) International http://www.iana.org/domains/idn-tables/ (.BR) Brazil http://registro.br/faq/faq6.html (.BV) Bouvett Island http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html (.CAT) Catalan http://www.iana.org/domains/idn-tables/tables/cat_ca_1.0.html (.CH) Switzerland https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1 (.CL) Chile http://www.iana.org/domains/idn-tables/tables/cl_latn_1.0.html (.COM) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html (.DE) Germany http://www.denic.de/en/domains/idns/liste.html (.DK) Danmark http://www.dk-hostmaster.dk/index.php?id=151 (.ES) Spain https://www.nic.es/media/2008-05/1210147705287.pdf (.FI) Finland http://www.ficora.fi/en/index/palvelut/fiverkkotunnukset/aakkostenkaytto.html (.GR) Greece https://grweb.ics.forth.gr/CharacterTable1_en.jsp (.HU) Hungary http://www.domain.hu/domain/English/szabalyzat/szabalyzat.html (.INFO) International http://www.nic.info/info/idn (.IO) British Indian Ocean Territory http://www.nic.io/IO-IDN-Policy.pdf (.IR) Iran http://www.nic.ir/Allowable_Characters_dot-iran (.IS) Iceland http://www.isnic.is/domain/rules.php (.KR) Korea http://www.iana.org/domains/idn-tables/tables/kr_ko-kr_1.0.html (.LI) Liechtenstein https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1 (.LT) Lithuania http://www.domreg.lt/static/doc/public/idn_symbols-en.pdf (.MD) Moldova http://www.register.md/ (.MUSEUM) International http://www.iana.org/domains/idn-tables/tables/museum_latn_1.0.html (.NET) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html (.NO) Norway http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html (.NU) Niue http://www.worldnames.net/ (.ORG) International http://www.pir.org/index.php?db=content/FAQs&tbl=FAQs_Registrant&id=2 (.PE) Peru https://www.nic.pe/nuevas_politicas_faq_2.php (.PL) Poland http://www.dns.pl/IDN/allowed_character_sets.pdf (.PR) Puerto Rico http://www.nic.pr/idn_rules.asp (.PT) Portugal https://online.dns.pt/dns_2008/do?com=DS;8216320233;111;+PAGE(4000058)+K-CAT-CODIGO(C.125)+RCNT(100); (.RU) Russia http://www.iana.org/domains/idn-tables/tables/ru_ru-ru_1.0.html (.SA) Saudi Arabia http://www.iana.org/domains/idn-tables/tables/sa_ar_1.0.html (.SE) Sweden http://www.iis.se/english/IDN_campaignsite.shtml?lang=en (.SH) Saint Helena http://www.nic.sh/SH-IDN-Policy.pdf (.SJ) Svalbard and Jan Mayen http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html (.TH) Thailand http://www.iana.org/domains/idn-tables/tables/th_th-th_1.0.html (.TM) Turkmenistan http://www.nic.tm/TM-IDN-Policy.pdf (.TR) Turkey https://www.nic.tr/index.php (.VE) Venice http://www.iana.org/domains/idn-tables/tables/ve_es_1.0.html (.VN) Vietnam http://www.vnnic.vn/english/5-6-300-2-2-04-20071115.htm#1.%20Introduction
- access: protected

array $_validTlds = 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'
) (line 117)

Array of valid top-level-domains

- see: ftp://data.iana.org/TLD/tlds-alpha-by-domain.txt List of all TLDs by domain
- see: http://www.iana.org/domains/root/db/ Official list of supported TLDs
- access: protected

#### Inherited Variables

Inherited from Zend_Validate_Abstract

> Zend_Validate_Abstract::$_defaultTranslator
> Zend_Validate_Abstract::$_errors
> Zend_Validate_Abstract::$_messageLength
> Zend_Validate_Abstract::$_messages
> Zend_Validate_Abstract::$_obscureValue
> Zend_Validate_Abstract::$_translator
> Zend_Validate_Abstract::$_translatorDisabled
> Zend_Validate_Abstract::$_value

Methods
decodePunycode (line 667)

Decodes a punycode encoded string to it's original utf8 string In case of a decoding failure the original string is returned

- access: protected

string decodePunycode (string $encoded)

- string $encoded: Punycode encoded string to decode

getAllow (line 424)

Returns the allow option

- access: public

integer getAllow ()
getIpValidator (line 400)

Returns the set ip validator

- access: public

Zend_Validate_Ip getIpValidator ()
getOptions (line 363)

Returns all set options

- access: public

array getOptions ()
getValidateIdn (line 446)

Returns the set idn option

- access: public

boolean getValidateIdn ()
getValidateTld (line 469)

Returns the set tld option

- access: public

boolean getValidateTld ()
isValid (line 496)

Defined by Zend_Validate_Interface

Returns true if and only if the $value is a valid hostname with respect to the current allow option

- throws: Zend_Validate_Exception if a fatal error occurs for validation process
- access: public

boolean isValid (string $value)

- string $value

Constructor __construct (line 332)

Sets validator options

- see: http://www.iana.org/cctld/specifications-policies-cctlds-01apr02.htm Technical Specifications for ccTLDs
- access: public

void __construct ([ $options = array()], integer $allow, boolean $validateIdn, boolean $validateTld, Zend_Validate_Ip $ipValidator)

- 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
- $options

setAllow (line 435)

Sets the allow option

- return: Provides a fluent interface
- access: public

Zend_Validate_Hostname setAllow (integer $allow)

- integer $allow

setIpValidator (line 409)

- access: public

void; setIpValidator ([Zend_Validate_Ip $ipValidator = null])

- Zend_Validate_Ip $ipValidator: OPTIONAL

setOptions (line 374)

Sets the options for this validator

- access: public

Zend_Validate_Hostname setOptions (array $options)

- array $options

setValidateIdn (line 458)

Set whether IDN domains are validated

This only applies when DNS hostnames are validated

- access: public

void setValidateIdn (boolean $allowed)

- boolean $allowed: Set allowed to true to validate IDNs, and false to not validate them

setValidateTld (line 481)

Set whether the TLD element of a hostname is validated

This only applies when DNS hostnames are validated

- access: public

void setValidateTld (boolean $allowed)

- boolean $allowed: Set allowed to true to validate TLDs, and false to not validate them

#### Inherited Methods

Inherited From Zend_Validate_Abstract

> Zend_Validate_Abstract::getDefaultTranslator()
> Zend_Validate_Abstract::getErrors()
> Zend_Validate_Abstract::getMessageLength()
> Zend_Validate_Abstract::getMessages()
> Zend_Validate_Abstract::getMessageTemplates()
> Zend_Validate_Abstract::getMessageVariables()
> Zend_Validate_Abstract::getObscureValue()
> Zend_Validate_Abstract::getTranslator()
> Zend_Validate_Abstract::hasDefaultTranslator()
> Zend_Validate_Abstract::hasTranslator()
> Zend_Validate_Abstract::setDefaultTranslator()
> Zend_Validate_Abstract::setDisableTranslator()
> Zend_Validate_Abstract::setMessage()
> Zend_Validate_Abstract::setMessageLength()
> Zend_Validate_Abstract::setMessages()
> Zend_Validate_Abstract::setObscureValue()
> Zend_Validate_Abstract::setTranslator()
> Zend_Validate_Abstract::translatorIsDisabled()
> Zend_Validate_Abstract::_createMessage()
> Zend_Validate_Abstract::_error()
> Zend_Validate_Abstract::_setValue()
> Zend_Validate_Abstract::__get()

Class Constants
ALLOW_ALL = 7 (line 103)

Allows all types of hostnames

ALLOW_DNS = 1 (line 88)

Allows Internet domain names (e.g., example.com)

ALLOW_IP = 2 (line 93)

Allows IP addresses

ALLOW_LOCAL = 4 (line 98)

Allows local network names (e.g., localhost, www.localdomain)

ALLOW_URI = 8 (line 108)

Allows all types of hostnames

CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode' (line 49)
INVALID = 'hostnameInvalid' (line 50)
INVALID_DASH = 'hostnameDashCharacter' (line 51)
INVALID_HOSTNAME = 'hostnameInvalidHostname' (line 52)
INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema' (line 53)
INVALID_LOCAL_NAME = 'hostnameInvalidLocalName' (line 54)
INVALID_URI = 'hostnameInvalidUri' (line 55)
IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed' (line 56)
LOCAL_NAME_NOT_ALLOWED = 'hostnameLocalNameNotAllowed' (line 57)
UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld' (line 58)
UNKNOWN_TLD = 'hostnameUnknownTld' (line 59)

Documentation generated on Tue, 26 Oct 2010 20:08:49 +0400 by phpDocumentor 1.4.2