From 0514d155fa59341374406b9d1ed365b0a60310c8 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Fri, 15 Sep 2023 11:55:43 +0800 Subject: [PATCH] Validate new email addresses #9866 --- library/Zend/Validate/Hostname.php | 682 +++++++++++++++++++-------- tests/Zend/Validate/HostnameTest.php | 2 +- 2 files changed, 494 insertions(+), 190 deletions(-) diff --git a/library/Zend/Validate/Hostname.php b/library/Zend/Validate/Hostname.php index bde0a3dd..32bc24fe 100644 --- a/library/Zend/Validate/Hostname.php +++ b/library/Zend/Validate/Hostname.php @@ -115,16 +115,20 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract */ protected $_validTlds = [ 'aaa', + 'aarp', 'abb', 'abbott', + 'abbvie', + 'abc', + 'able', 'abogado', + 'abudhabi', 'ac', 'academy', 'accenture', 'accountant', 'accountants', 'aco', - 'active', 'actor', 'ad', 'ads', @@ -132,67 +136,109 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'ae', 'aeg', 'aero', + 'aetna', 'af', 'afl', + 'africa', 'ag', + 'agakhan', 'agency', 'ai', 'aig', + 'airbus', 'airforce', 'airtel', + 'akdn', 'al', + 'alibaba', + 'alipay', 'allfinanz', + 'allstate', + 'ally', 'alsace', + 'alstom', 'am', + 'amazon', + 'americanexpress', + 'americanfamily', + 'amex', + 'amfam', 'amica', 'amsterdam', + 'analytics', 'android', + 'anquan', + 'anz', 'ao', + 'aol', 'apartments', 'app', + 'apple', 'aq', 'aquarelle', 'ar', + 'arab', 'aramco', 'archi', 'army', 'arpa', + 'art', 'arte', 'as', + 'asda', 'asia', 'associates', 'at', + 'athleta', 'attorney', 'au', 'auction', + 'audi', + 'audible', 'audio', + 'auspost', + 'author', 'auto', 'autos', + 'avianca', 'aw', + 'aws', 'ax', 'axa', 'az', 'azure', 'ba', + 'baby', + 'baidu', + 'banamex', + 'bananarepublic', 'band', 'bank', 'bar', 'barcelona', 'barclaycard', 'barclays', + 'barefoot', 'bargains', + 'baseball', + 'basketball', 'bauhaus', 'bayern', 'bb', 'bbc', + 'bbt', 'bbva', + 'bcg', 'bcn', 'bd', 'be', + 'beats', + 'beauty', 'beer', 'bentley', 'berlin', 'best', + 'bestbuy', 'bet', 'bf', 'bg', @@ -209,33 +255,43 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'bj', 'black', 'blackfriday', + 'blockbuster', + 'blog', 'bloomberg', 'blue', 'bm', 'bms', 'bmw', 'bn', - 'bnl', 'bnpparibas', 'bo', 'boats', + 'boehringer', + 'bofa', 'bom', 'bond', 'boo', - 'boots', + 'book', + 'booking', + 'bosch', + 'bostik', + 'boston', + 'bot', 'boutique', + 'box', 'br', 'bradesco', 'bridgestone', + 'broadway', 'broker', 'brother', 'brussels', 'bs', 'bt', - 'budapest', 'build', 'builders', 'business', + 'buy', 'buzz', 'bv', 'bw', @@ -246,12 +302,15 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'cab', 'cafe', 'cal', + 'call', + 'calvinklein', + 'cam', 'camera', 'camp', - 'cancerresearch', 'canon', 'capetown', 'capital', + 'capitalone', 'car', 'caravan', 'cards', @@ -259,17 +318,19 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'career', 'careers', 'cars', - 'cartier', 'casa', + 'case', 'cash', 'casino', 'cat', 'catering', + 'catholic', 'cba', 'cbn', + 'cbre', + 'cbs', 'cc', 'cd', - 'ceb', 'center', 'ceo', 'cern', @@ -280,23 +341,30 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'ch', 'chanel', 'channel', + 'charity', + 'chase', 'chat', 'cheap', - 'chloe', + 'chintai', 'christmas', 'chrome', 'church', 'ci', 'cipriani', + 'circle', 'cisco', + 'citadel', + 'citi', 'citic', 'city', + 'cityeats', 'ck', 'cl', 'claims', 'cleaning', 'click', 'clinic', + 'clinique', 'clothing', 'cloud', 'club', @@ -310,29 +378,36 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'college', 'cologne', 'com', + 'comcast', 'commbank', 'community', 'company', + 'compare', 'computer', + 'comsec', 'condos', 'construction', 'consulting', + 'contact', 'contractors', 'cooking', 'cool', 'coop', 'corsica', 'country', + 'coupon', 'coupons', 'courses', + 'cpa', 'cr', 'credit', 'creditcard', + 'creditunion', 'cricket', 'crown', 'crs', + 'cruise', 'cruises', - 'csc', 'cu', 'cuisinella', 'cv', @@ -345,16 +420,21 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'dabur', 'dad', 'dance', + 'data', 'date', 'dating', 'datsun', 'day', 'dclk', + 'dds', 'de', + 'deal', + 'dealer', 'deals', 'degree', 'delivery', 'dell', + 'deloitte', 'delta', 'democrat', 'dental', @@ -362,30 +442,41 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'desi', 'design', 'dev', + 'dhl', 'diamonds', 'diet', 'digital', 'direct', 'directory', 'discount', + 'discover', + 'dish', + 'diy', 'dj', 'dk', 'dm', 'dnp', 'do', 'docs', + 'doctor', 'dog', - 'doha', 'domains', - 'doosan', + 'dot', 'download', 'drive', + 'dtv', + 'dubai', + 'dunlop', + 'dupont', 'durban', 'dvag', + 'dvr', 'dz', 'earth', 'eat', 'ec', + 'eco', + 'edeka', 'edu', 'education', 'ee', @@ -399,34 +490,46 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'epson', 'equipment', 'er', + 'ericsson', 'erni', 'es', 'esq', 'estate', 'et', + 'etisalat', 'eu', 'eurovision', 'eus', 'events', - 'everbank', 'exchange', 'expert', 'exposed', 'express', + 'extraspace', 'fage', 'fail', + 'fairwinds', 'faith', 'family', 'fan', 'fans', 'farm', + 'farmers', 'fashion', + 'fast', + 'fedex', 'feedback', + 'ferrari', + 'ferrero', 'fi', + 'fidelity', + 'fido', 'film', 'final', 'finance', 'financial', + 'fire', + 'firestone', 'firmdale', 'fish', 'fishing', @@ -434,22 +537,33 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'fitness', 'fj', 'fk', + 'flickr', 'flights', + 'flir', 'florist', 'flowers', - 'flsmidth', 'fly', 'fm', 'fo', 'foo', + 'food', 'football', + 'ford', 'forex', 'forsale', 'forum', 'foundation', + 'fox', 'fr', + 'free', + 'fresenius', 'frl', 'frogans', + 'frontdoor', + 'frontier', + 'ftr', + 'fujitsu', + 'fun', 'fund', 'furniture', 'futbol', @@ -457,8 +571,13 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'ga', 'gal', 'gallery', + 'gallo', + 'gallup', 'game', + 'games', + 'gap', 'garden', + 'gay', 'gb', 'gbiz', 'gd', @@ -467,6 +586,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'gea', 'gent', 'genting', + 'george', 'gf', 'gg', 'ggee', @@ -483,28 +603,35 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'globo', 'gm', 'gmail', + 'gmbh', 'gmo', 'gmx', 'gn', + 'godaddy', 'gold', 'goldpoint', 'golf', 'goo', + 'goodyear', 'goog', 'google', 'gop', + 'got', 'gov', 'gp', 'gq', 'gr', + 'grainger', 'graphics', 'gratis', 'green', 'gripe', + 'grocery', 'group', 'gs', 'gt', 'gu', + 'guardian', 'gucci', 'guge', 'guide', @@ -512,29 +639,41 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'guru', 'gw', 'gy', + 'hair', 'hamburg', 'hangout', 'haus', + 'hbo', + 'hdfc', + 'hdfcbank', + 'health', 'healthcare', 'help', + 'helsinki', 'here', 'hermes', 'hiphop', + 'hisamitsu', 'hitachi', 'hiv', 'hk', + 'hkt', 'hm', 'hn', 'hockey', 'holdings', 'holiday', 'homedepot', + 'homegoods', 'homes', + 'homesense', 'honda', 'horse', + 'hospital', 'host', 'hosting', - 'hoteles', + 'hot', + 'hotels', 'hotmail', 'house', 'how', @@ -542,6 +681,8 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'hsbc', 'ht', 'hu', + 'hughes', + 'hyatt', 'hyundai', 'ibm', 'icbc', @@ -549,22 +690,28 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'icu', 'id', 'ie', + 'ieee', 'ifm', - 'iinet', + 'ikano', 'il', 'im', + 'imamat', + 'imdb', 'immo', 'immobilien', 'in', + 'inc', 'industries', 'infiniti', 'info', 'ing', 'ink', 'institute', + 'insurance', 'insure', 'int', 'international', + 'intuit', 'investments', 'io', 'ipiranga', @@ -572,56 +719,78 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'ir', 'irish', 'is', + 'ismaili', 'ist', 'istanbul', 'it', 'itau', - 'iwc', + 'itv', 'jaguar', 'java', 'jcb', 'je', + 'jeep', 'jetzt', 'jewelry', - 'jlc', + 'jio', 'jll', 'jm', + 'jmp', + 'jnj', 'jo', 'jobs', 'joburg', + 'jot', + 'joy', 'jp', + 'jpmorgan', 'jprs', 'juegos', + 'juniper', 'kaufen', 'kddi', 'ke', + 'kerryhotels', + 'kerrylogistics', + 'kerryproperties', + 'kfh', 'kg', 'kh', 'ki', 'kia', + 'kids', 'kim', 'kinder', + 'kindle', 'kitchen', 'kiwi', 'km', 'kn', 'koeln', 'komatsu', + 'kosher', 'kp', + 'kpmg', + 'kpn', 'kr', 'krd', 'kred', + 'kuokgroup', 'kw', 'ky', 'kyoto', 'kz', 'la', 'lacaixa', + 'lamborghini', + 'lamer', 'lancaster', 'land', 'landrover', + 'lanxess', 'lasalle', 'lat', + 'latino', 'latrobe', 'law', 'lawyer', @@ -630,35 +799,47 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'lds', 'lease', 'leclerc', + 'lefrak', 'legal', + 'lego', 'lexus', 'lgbt', 'li', - 'liaison', 'lidl', 'life', + 'lifeinsurance', + 'lifestyle', 'lighting', + 'like', + 'lilly', 'limited', 'limo', - 'linde', + 'lincoln', 'link', + 'lipsy', 'live', - 'lixil', + 'living', 'lk', + 'llc', + 'llp', 'loan', 'loans', + 'locker', + 'locus', 'lol', 'london', 'lotte', 'lotto', 'love', + 'lpl', + 'lplfinancial', 'lr', 'ls', 'lt', 'ltd', 'ltda', 'lu', - 'lupin', + 'lundbeck', 'luxe', 'luxury', 'lv', @@ -667,17 +848,23 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'madrid', 'maif', 'maison', + 'makeup', 'man', 'management', 'mango', + 'map', 'market', 'marketing', 'markets', 'marriott', + 'marshalls', + 'mattel', 'mba', 'mc', + 'mckinsey', 'md', 'me', + 'med', 'media', 'meet', 'melbourne', @@ -685,75 +872,95 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'memorial', 'men', 'menu', + 'merckmsd', 'mg', 'mh', 'miami', 'microsoft', 'mil', 'mini', + 'mint', + 'mit', + 'mitsubishi', 'mk', 'ml', + 'mlb', + 'mls', 'mm', 'mma', 'mn', 'mo', 'mobi', + 'mobile', 'moda', 'moe', 'moi', 'mom', 'monash', 'money', - 'montblanc', + 'monster', 'mormon', 'mortgage', 'moscow', + 'moto', 'motorcycles', 'mov', 'movie', - 'movistar', 'mp', 'mq', 'mr', 'ms', + 'msd', 'mt', 'mtn', - 'mtpc', 'mtr', 'mu', 'museum', - 'mutuelle', + 'music', 'mv', 'mw', 'mx', 'my', 'mz', 'na', - 'nadex', + 'nab', 'nagoya', 'name', + 'natura', 'navy', + 'nba', 'nc', 'ne', 'nec', 'net', 'netbank', + 'netflix', 'network', 'neustar', 'new', 'news', + 'next', + 'nextdirect', 'nexus', 'nf', + 'nfl', 'ng', 'ngo', 'nhk', 'ni', 'nico', + 'nike', + 'nikon', 'ninja', 'nissan', + 'nissay', 'nl', 'no', 'nokia', + 'norton', + 'now', + 'nowruz', + 'nowtv', 'np', 'nr', 'nra', @@ -763,8 +970,13 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'nyc', 'nz', 'obi', + 'observer', 'office', 'okinawa', + 'olayan', + 'olayangroup', + 'oldnavy', + 'ollo', 'om', 'omega', 'one', @@ -772,78 +984,106 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'onl', 'online', 'ooo', + 'open', 'oracle', 'orange', 'org', 'organic', + 'origins', 'osaka', 'otsuka', + 'ott', 'ovh', 'pa', 'page', - 'panerai', + 'panasonic', 'paris', + 'pars', 'partners', 'parts', 'party', + 'pay', + 'pccw', 'pe', 'pet', 'pf', + 'pfizer', 'pg', 'ph', 'pharmacy', + 'phd', 'philips', + 'phone', 'photo', 'photography', 'photos', 'physio', - 'piaget', 'pics', 'pictet', 'pictures', + 'pid', + 'pin', + 'ping', 'pink', + 'pioneer', 'pizza', 'pk', 'pl', 'place', 'play', + 'playstation', 'plumbing', 'plus', 'pm', 'pn', + 'pnc', 'pohl', 'poker', + 'politie', 'porn', 'post', 'pr', + 'pramerica', 'praxi', 'press', + 'prime', 'pro', 'prod', 'productions', 'prof', + 'progressive', + 'promo', 'properties', 'property', 'protection', + 'pru', + 'prudential', 'ps', 'pt', 'pub', 'pw', + 'pwc', 'py', 'qa', 'qpon', 'quebec', + 'quest', 'racing', + 'radio', 're', + 'read', + 'realestate', 'realtor', 'realty', 'recipes', 'red', 'redstone', + 'redumbrella', 'rehab', 'reise', 'reisen', 'reit', + 'reliance', 'ren', 'rent', 'rentals', @@ -854,16 +1094,23 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'restaurant', 'review', 'reviews', + 'rexroth', 'rich', + 'richardli', 'ricoh', + 'ril', 'rio', 'rip', 'ro', + 'rocher', 'rocks', 'rodeo', + 'rogers', + 'room', 'rs', 'rsvp', 'ru', + 'rugby', 'ruhr', 'run', 'rw', @@ -871,77 +1118,112 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'ryukyu', 'sa', 'saarland', + 'safe', + 'safety', 'sakura', 'sale', + 'salon', + 'samsclub', 'samsung', 'sandvik', 'sandvikcoromant', 'sanofi', 'sap', 'sarl', + 'sas', + 'save', 'saxo', 'sb', + 'sbi', + 'sbs', 'sc', 'sca', 'scb', + 'schaeffler', 'schmidt', 'scholarships', 'school', 'schule', 'schwarz', 'science', - 'scor', 'scot', 'sd', 'se', + 'search', 'seat', + 'secure', 'security', 'seek', + 'select', 'sener', 'services', 'seven', 'sew', 'sex', 'sexy', + 'sfr', 'sg', 'sh', + 'shangrila', + 'sharp', + 'shaw', + 'shell', + 'shia', 'shiksha', 'shoes', + 'shop', + 'shopping', + 'shouji', 'show', - 'shriram', + 'showtime', 'si', + 'silk', + 'sina', 'singles', 'site', 'sj', 'sk', 'ski', + 'skin', 'sky', 'skype', 'sl', + 'sling', 'sm', + 'smart', + 'smile', 'sn', 'sncf', 'so', 'soccer', 'social', + 'softbank', 'software', 'sohu', 'solar', 'solutions', + 'song', 'sony', 'soy', + 'spa', 'space', - 'spiegel', - 'spreadbetting', + 'sport', + 'spot', 'sr', 'srl', + 'ss', 'st', 'stada', - 'starhub', - 'statoil', + 'staples', + 'star', + 'statebank', + 'statefarm', 'stc', 'stcgroup', 'stockholm', + 'storage', + 'store', + 'stream', 'studio', 'study', 'style', @@ -961,36 +1243,47 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'sydney', 'systems', 'sz', + 'tab', 'taipei', + 'talk', + 'taobao', + 'target', 'tatamotors', 'tatar', 'tattoo', 'tax', 'taxi', 'tc', + 'tci', 'td', + 'tdk', 'team', 'tech', 'technology', 'tel', - 'telefonica', 'temasek', 'tennis', + 'teva', 'tf', 'tg', 'th', 'thd', 'theater', 'theatre', + 'tiaa', 'tickets', 'tienda', 'tips', 'tires', 'tirol', 'tj', + 'tjmaxx', + 'tjx', 'tk', + 'tkmaxx', 'tl', 'tm', + 'tmall', 'tn', 'to', 'today', @@ -999,6 +1292,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'top', 'toray', 'toshiba', + 'total', 'tours', 'town', 'toyota', @@ -1008,57 +1302,82 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'trading', 'training', 'travel', + 'travelers', + 'travelersinsurance', 'trust', + 'trv', 'tt', + 'tube', 'tui', + 'tunes', + 'tushu', 'tv', + 'tvs', 'tw', 'tz', 'ua', + 'ubank', 'ubs', 'ug', 'uk', + 'unicom', 'university', 'uno', 'uol', + 'ups', 'us', 'uy', 'uz', 'va', 'vacations', + 'vana', + 'vanguard', 'vc', 've', 'vegas', 'ventures', + 'verisign', 'versicherung', 'vet', 'vg', 'vi', 'viajes', 'video', + 'vig', + 'viking', 'villas', 'vin', + 'vip', 'virgin', + 'visa', 'vision', - 'vista', - 'vistaprint', 'viva', + 'vivo', 'vlaanderen', 'vn', 'vodka', + 'volkswagen', + 'volvo', 'vote', 'voting', 'voto', 'voyage', 'vu', 'wales', + 'walmart', 'walter', 'wang', + 'wanggou', 'watch', + 'watches', + 'weather', + 'weatherchannel', 'webcam', + 'weber', 'website', 'wed', 'wedding', + 'weibo', 'weir', 'wf', 'whoswho', @@ -1068,222 +1387,165 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'win', 'windows', 'wine', + 'winners', 'wme', + 'wolterskluwer', + 'woodside', 'work', 'works', 'world', + 'wow', 'ws', 'wtc', 'wtf', 'xbox', 'xerox', + 'xfinity', + 'xihuan', 'xin', - 'xn--11b4c3d', - 'xn--1qqw23a', - 'xn--30rr7y', - 'xn--3bst00m', - 'xn--3ds443g', - 'xn--3e0b707e', - 'xn--3pxu8k', - 'xn--42c2d9a', - 'xn--45brj9c', - 'xn--45q11c', - 'xn--4gbrim', - 'xn--55qw42g', - 'xn--55qx5d', - 'xn--6frz82g', - 'xn--6qq986b3xl', - 'xn--80adxhks', - 'xn--80ao21a', - 'xn--80asehdb', - 'xn--80aswg', - 'xn--90a3ac', - 'xn--90ais', - 'xn--9dbq2a', - 'xn--9et52u', - 'xn--b4w605ferd', - 'xn--c1avg', - 'xn--c2br7g', - 'xn--cg4bki', - 'xn--clchc0ea0b2g2a9gcd', - 'xn--czr694b', - 'xn--czrs0t', - 'xn--czru2d', - 'xn--d1acj3b', - 'xn--d1alf', - 'xn--efvy88h', - 'xn--estv75g', - 'xn--fhbei', - 'xn--fiq228c5hs', - 'xn--fiq64b', - 'xn--fiqs8s', - 'xn--fiqz9s', - 'xn--fjq720a', - 'xn--flw351e', - 'xn--fpcrj9c3d', - 'xn--fzc2c9e2c', - 'xn--gecrj9c', - 'xn--h2brj9c', - 'xn--hxt814e', - 'xn--i1b6b1a6a2e', - 'xn--imr513n', - 'xn--io0a7i', - 'xn--j1aef', - 'xn--j1amh', - 'xn--j6w193g', - 'xn--kcrx77d1x4a', - 'xn--kprw13d', - 'xn--kpry57d', - 'xn--kput3i', - 'xn--l1acc', - 'xn--lgbbat1ad8j', - 'xn--mgb9awbf', - 'xn--mgba3a3ejt', - 'xn--mgba3a4f16a', - 'xn--mgbaam7a8h', - 'xn--mgbab2bd', - 'xn--mgbayh7gpa', - 'xn--mgbbh1a71e', - 'xn--mgbc0a9azcg', - 'xn--mgberp4a5d4ar', - 'xn--mgbpl2fh', - 'xn--mgbx4cd0ab', - 'xn--mk1bu44c', - 'xn--mxtq1m', - 'xn--ngbc5azd', - 'xn--node', - 'xn--nqv7f', - 'xn--nqv7fs00ema', - 'xn--nyqy26a', - 'xn--o3cw4h', - 'xn--ogbpf8fl', - 'xn--p1acf', - 'xn--p1ai', - 'xn--pgbs0dh', - 'xn--pssy2u', - 'xn--q9jyb4c', - 'xn--qcka1pmc', - 'xn--rhqv96g', - 'xn--s9brj9c', - 'xn--ses554g', - 'xn--t60b56a', - 'xn--tckwe', - 'xn--unup4y', - 'xn--vermgensberater-ctb', - 'xn--vermgensberatung-pwb', - 'xn--vhquv', - 'xn--vuq861b', - 'xn--wgbh1c', - 'xn--wgbl6a', - 'xn--xhq521b', - 'xn--xkc2al3hye2a', - 'xn--xkc2dl3a5ee0h', - 'xn--y9a3aq', - 'xn--yfro4i67o', - 'xn--ygbi2ammx', - 'xn--zfr164b', - 'xperia', - 'xxx', - 'xyz', - 'yachts', - 'yamaxun', - 'yandex', - 'ye', - 'yodobashi', - 'yoga', - 'yokohama', - 'youtube', - 'yt', - 'za', - 'zara', - 'zip', - 'zm', - 'zone', - 'zuerich', - 'zw', - '测试', - 'परीक्षा', + 'कॉम', + 'セール', '佛山', + 'ಭಾರತ', + '慈善', '集团', '在线', '한국', + 'ଭାରତ', + '点看', + 'คอม', + 'ভাৰত', 'ভারত', '八卦', + 'ישראל', 'موقع', 'বাংলা', '公益', '公司', + '香格里拉', + '网站', '移动', '我爱你', 'москва', - 'испытание', 'қаз', + 'католик', 'онлайн', 'сайт', + '联通', 'срб', + 'бг', 'бел', - '테스트', + 'קום', + '时尚', + '微博', + '淡马锡', + 'ファッション', 'орг', + 'नेट', + 'ストア', + 'アマゾン', '삼성', 'சிங்கப்பூர்', '商标', + '商店', '商城', 'дети', 'мкд', - 'טעסט', + 'ею', + 'ポイント', + '新闻', + '家電', + 'كوم', '中文网', '中信', '中国', '中國', + '娱乐', '谷歌', 'భారత్', 'ලංකා', - '測試', + '電訊盈科', + '购物', + 'クラウド', 'ભારત', + '通販', + 'भारतम्', 'भारत', - 'آزمایشی', - 'பரிட்சை', + 'भारोत', + '网店', 'संगठन', + '餐厅', '网络', + 'ком', 'укр', '香港', - 'δοκιμή', - 'إختبار', + '亚马逊', + '食品', + '飞利浦', '台湾', '台灣', '手机', 'мон', 'الجزائر', 'عمان', + 'ارامكو', 'ایران', + 'العليان', + 'اتصالات', 'امارات', 'بازار', + 'موريتانيا', 'پاکستان', 'الاردن', + 'بارت', 'بھارت', 'المغرب', + 'ابوظبي', + 'البحرين', 'السعودية', + 'ڀارت', + 'كاثوليك', 'سودان', + 'همراه', 'عراق', 'مليسيا', + '澳門', + '닷컴', + '政府', 'شبكة', + 'بيتك', + 'عرب', 'გე', '机构', '组织机构', + '健康', 'ไทย', 'سورية', + '招聘', 'рус', 'рф', 'تونس', + '大拿', + 'ລາວ', 'みんな', 'グーグル', + 'ευ', + 'ελ', '世界', + '書籍', + 'ഭാരതം', 'ਭਾਰਤ', '网址', + '닷넷', + 'コム', + '天主教', '游戏', 'vermögensberater', 'vermögensberatung', '企业', + '信息', + '嘉里大酒店', + '嘉里', 'مصر', 'قطر', '广东', @@ -1292,8 +1554,30 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'հայ', '新加坡', 'فلسطين', - 'テスト', '政务', + 'xxx', + 'xyz', + 'yachts', + 'yahoo', + 'yamaxun', + 'yandex', + 'ye', + 'yodobashi', + 'yoga', + 'yokohama', + 'you', + 'youtube', + 'yt', + 'yun', + 'za', + 'zappos', + 'zara', + 'zero', + 'zip', + 'zm', + 'zone', + 'zuerich', + 'zw', ]; /** @@ -1363,35 +1647,42 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'BIZ' => 'Hostname/Biz.php', 'BR' => [1 => '/^[\x{002d}0-9a-zà-ãçéíó-õúü]{1,63}$/iu'], 'BV' => [1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'], - 'CA' => [1 => '/^[\x{002d}0-9a-zàâæçéèêëîïôœùûüÿ\x{00E0}\x{00E2}\x{00E7}\x{00E8}\x{00E9}\x{00EA}\x{00EB}\x{00EE}\x{00EF}\x{00F4}\x{00F9}\x{00FB}\x{00FC}\x{00E6}\x{0153}\x{00FF}]{1,63}$/iu'], 'CAT' => [1 => '/^[\x{002d}0-9a-z·àç-éíïòóúü]{1,63}$/iu'], 'CH' => [1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'], 'CL' => [1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'], 'CN' => 'Hostname/Cn.php', 'COM' => 'Hostname/Com.php', - 'DE' => [1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťßţŧŭůűũųūŵŷźžż]{1,63}$/iu'], - 'DK' => [1 => '/^[\x{002d}0-9a-zäéöüæøå]{1,63}$/iu'], + 'DE' => [1 => '/^[\x{002d}0-9a-záàăâåäãąāæćĉčċçďđéèĕêěëėęēğĝġģĥħíìĭîïĩįīıĵķĺľļłńňñņŋóòŏôöőõøōœĸŕřŗśŝšşßťţŧúùŭûůüűũųūŵýŷÿźžżðþ]{1,63}$/iu'], + 'DK' => [1 => '/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu'], + 'EE' => [1 => '/^[\x{002d}0-9a-zäõöüšž]{1,63}$/iu'], 'ES' => [1 => '/^[\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'], - 'EU' => [1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu', + 'EU' => [ + 1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu', 2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{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', ], + 6 => '/^[\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ὼώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ῒΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu', + ], 'FI' => [1 => '/^[\x{002d}0-9a-zäåö]{1,63}$/iu'], 'GR' => [1 => '/^[\x{002d}0-9a-zΆΈΉΊΌΎ-ΡΣ-ώἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼῂῃῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲῳῴῶ-ῼ]{1,63}$/iu'], 'HK' => 'Hostname/Cn.php', + 'HR' => [1 => '/^[\x{002d}0-9a-zžćčđš]{1,63}$/iu'], 'HU' => [1 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu'], - 'IL' => [1 => '/^[\x{002d}0-9\x{05D0}-\x{05EA}]{1,63}$/iu', - 2 => '/^[\x{002d}0-9a-z]{1,63}$/i', ], - 'INFO' => [1 => '/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu', + 'IL' => [ + 1 => '/^[\x{002d}0-9\x{05D0}-\x{05EA}]{1,63}$/iu', + 2 => '/^[\x{002d}0-9a-z]{1,63}$/i', + ], + 'INFO' => [ + 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', ], + 8 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu', + ], 'IO' => [1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'], 'IS' => [1 => '/^[\x{002d}0-9a-záéýúíóþæöð]{1,63}$/iu'], 'IT' => [1 => '/^[\x{002d}0-9a-zàâäèéêëìîïòôöùûüæœçÿß-]{1,63}$/iu'], @@ -1404,15 +1695,18 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'NET' => 'Hostname/Com.php', 'NO' => [1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'], 'NU' => 'Hostname/Com.php', - 'ORG' => [1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu', + 'ORG' => [ + 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', ], + 7 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu', + ], 'PE' => [1 => '/^[\x{002d}0-9a-zñáéíóúü]{1,63}$/iu'], - 'PL' => [1 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu', + 'PL' => [ + 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', @@ -1444,10 +1738,11 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 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', ], + 33 => '/^[\x{002d}0-9א-ת]{1,63}$/iu', + ], 'PR' => [1 => '/^[\x{002d}0-9a-záéíóúñäëïüöâêîôûàèùæçœãõ]{1,63}$/iu'], 'PT' => [1 => '/^[\x{002d}0-9a-záàâãçéêíóôõú]{1,63}$/iu'], - 'RS' => [1 => '/^[\x{002D}\x{0030}-\x{0039}\x{0061}-\x{007A}\x{0107}\x{010D}\x{0111}\x{0161}\x{017E}]{1,63}$/iu)'], + 'RS' => [1 => '/^[\x{002d}0-9a-zßáâäçéëíîóôöúüýăąćčďđęěĺľłńňőŕřśşšţťůűźżž]{1,63}$/iu'], 'RU' => [1 => '/^[\x{002d}0-9а-яё]{1,63}$/iu'], 'SA' => [1 => '/^[\x{002d}.0-9\x{0621}-\x{063A}\x{0641}-\x{064A}\x{0660}-\x{0669}]{1,63}$/iu'], 'SE' => [1 => '/^[\x{002d}0-9a-zäåéöü]{1,63}$/iu'], @@ -1455,7 +1750,8 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'SI' => [ 1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu', 2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu', - 3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu', ], + 3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu', + ], 'SJ' => [1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'], 'TH' => [1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'], 'TM' => [1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'], @@ -1496,10 +1792,18 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'NET' => [3 => 17, 5 => 20], 'ORG' => [6 => 17], 'TW' => [1 => 20], - 'ایران' => [1 => 30], + 'امارات' => [1 => 30], + 'الاردن' => [1 => 30], + 'السعودية' => [1 => 30], + 'تونس' => [1 => 30], + 'مصر' => [1 => 30], + 'فلسطين' => [1 => 30], + 'شبكة' => [1 => 30], '中国' => [1 => 20], - '公司' => [1 => 20], - '网络' => [1 => 20], + '中國' => [1 => 20], + '香港' => [1 => 20], + '台湾' => [1 => 20], + '台灣' => [1 => 20], ]; protected $_options = [ diff --git a/tests/Zend/Validate/HostnameTest.php b/tests/Zend/Validate/HostnameTest.php index 56eeef77..5cb1e358 100644 --- a/tests/Zend/Validate/HostnameTest.php +++ b/tests/Zend/Validate/HostnameTest.php @@ -467,7 +467,7 @@ public function testIDNCA() $validator = new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL); $this->assertTrue($validator->isValid('Test123.ca')); - $this->assertTrue($validator->isValid('tàr.ca')); + $this->assertFalse($validator->isValid('tàr.ca')); $this->assertFalse($validator->isValid('țest123.ca')); $this->assertFalse($validator->isValid('tĕst123.ca')); $this->assertFalse($validator->isValid('رات.ca'));