URI and IRI validation
| From: | Pádraic Brady | Date: | Sat, 23 Jun 2007 10:27:54 +0000 |
| Subject: | URI and IRI validation | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-47109@lists.php.net to get a copy of this message | ||
Hi all,
More newbie checking on the way.
I was doing some tinkering inside the code for a third proposal (this time the heavy weight
Services_Yadis). I checked out the Validate packages and they have a small function for validating
URLs. I didn't see any validation being carried as part of the Net_Url package either.
One of the things I need to do, both for Yadis and OpenID is to validate a URI very strictly (to the
letter of the RFC). It also needs to be normalised, and have a method for defining certain URI parts
(e.g. a query string) as being always invalid.
Secondly, I need to add support for IDNs (Internationalised Domain Names) which allow for a subset
of Unicode characters in domain names within very specific ranges for a number of national TLDs. For
example, something like http://www.pádraic.ie (which will be
possible in a few years) or http://www.bücher.ch will all fail
the current Validate::uri() check.
IDN support has been growing recently - especially since Mozilla and Opera took a small beating over
proposing the remove it from their browsers (it allows new forms of phishing) and IE7 was released
with native support. *nix has had libidn sitting around since 2003. There's around 40 DNS
registries now supporting IDNs so far, including com, org, net, etc. (Verisign has been busy!).
I'll contact the current PHP4 author(s) for the Validate package, but would this be seen as
acceptable PHP5 proposal? Given the complexity, likely as a standalone Validate_URI. For the moment
I can package an alternative internal to the Yadis code.
Apologies for the growing mountain of proposals ;). OpenID is a fairground for this kind of code.
Paddy
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com
____________________________________________________________________________________
Got a little couch potato?
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz