NYCPHP Meetup

NYPHP.org

[nycphp-talk] somewhat OT Re: validating proper name capitalization

Jerry B. Altzman jbaltz at altzman.com
Tue Oct 4 12:23:33 EDT 2011


on 10/3/2011 5:17 PM Tedd Sperling said the following:
> PUNYCODE is the ULR for IDN (Internationalized Domain Names). PHP doesn't have to deal with it any more/less than any other URL.

I understand that, but I'm asking something like: if you type in •.com 
into your browser, what's getting passed to the server behind the 
scenes?  Are we dealing with $_SERVER['HOST_NAME'] being the unicode 
value?  If your browser punycodes that, how do you make sure that you 
are getting the same thing?  So what comes through in the HTTP header, 
what does the server see, what does the PHP interpreter see, and how do 
you match up http:// www.3Φ.com with  http:// www.xn--3-6mb.com?

Obviously I'm not talking about dealing (necessarily) with user input or 
display -- those are different things.  I don't run a server that hosts 
an IDN domain name, so I don't even know what ends up in the logs, and 
what PHP sees from the Hostname: HTTP field, and ... ?

(Oh cool, Verizon's mail server scanned this initially, found the IDN 
URL in the message, and determined this to be spam.  Neat! Therefore, I 
have added spaces above to thwart this behavior.)

> tedd

//jbaltz
-- 
jerry b. altzman | jbaltz at altzman.com | www.jbaltz.com | twitter:@lorvax
thank you for contributing to the heat death of the universe.



More information about the talk mailing list