mmn/OrigURL — Issue #2: filter_var rejects multibyte urls
Author: kabniel
Created: 2012-01-13 16:10:14+00:00
State: open

I came across this url today:
`
$ curl -I http://bit.ly/yyU1Xg
HTTP/1.1 301 Moved
Server: nginx
Date: Fri, 13 Jan 2012 14:20:02 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Set-Cookie: _bit=4f103d92-000f9-02c2a-341cf10a;domain=.bit.ly;expires=Wed Jul 11 14:20:02 2012;path=/; HttpOnly
Cache-control: private; max-age=90
Location: http://equitylinecreditx.com/e-cig-–-the-particular-upcoming-quit-cigarette-smoking-device/
MIME-Version: 1.0
Content-Length: 185
`

Location have a multibyte dash in it and FILTER_VALIDATE_URL used in filter_var() doesnt handle multibyte from what i understand.

We could probably fix it by doing a urlencode on the relevant parts (i think domains can be multibyte now too) before validating it, i tried to come up with something but my regex-fu is lacking ;)