Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Interface to add valid TLDs in Hostname validator #117

Open
peterkeatingie opened this issue Sep 25, 2016 · 2 comments
Open

Interface to add valid TLDs in Hostname validator #117

peterkeatingie opened this issue Sep 25, 2016 · 2 comments

Comments

@peterkeatingie
Copy link

I recently used this validator but found it did not support .car TLD. The company I work for recently purchased such a domain and we needed to allow valid email addresses with that TLD.

I needed to extend the existing validator and also extend the EmailAddress validator to be able to reach the TLD list and then could attach the new validator in Apigility and add a list of TLDs, which were pushed onto the array in Hostname validator.

It would have been quite useful to just have a public function in Hostname validator to add to the validTlds array. That is what I am proposing to do myself.

@adamlundrigan
Copy link
Contributor

There should be no need to extend the EmailAddress validator in this case; construct an instance of your extended Hostname validator and supply it to the EmailAddress instance through configuration option hostnameValidator or using the setHostnameValidator method.

Thanks to gTLDs the built-in TLD list falls out of sync with reality much more quickly than it used to when this validator was initially designed. As far as I'm aware there is no formalized process for keeping this list up-to-date; if there isn't it would be worthwhile to formulate one.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-validator; a new issue has been opened at laminas/laminas-validator#23.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants