Edit report at http://bugs.php.net/bug.php?id=53474&edit=1

 ID:                 53474
 Comment by:         gunther at keryx dot se
 Reported by:        gunther at keryx dot se
 Summary:            FILTER_VALIDATE_URL should not fail URL's that use
                     IDN
 Status:             Open
 Type:               Bug
 Package:            Filter related
 Operating System:   All
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

My initial test was done using PHP 5.3.3



The lack of IDN support is still present in 5.3.3



All of Mathias' additional test cases, but the last one are however
handled correctly. I.e. this one is approved:



http://a.b--c.de/



It should fail. That's probably an edge case, though. The lack of IDN
support is the worst problem.


Previous Comments:
------------------------------------------------------------------------
[2010-12-05 19:21:14] [email protected]

mathias, you are not testing the current code.  Try it with 5.3.3.

------------------------------------------------------------------------
[2010-12-05 10:46:21] mathias at qiwi dot be

I was trying to post a comment here, but it wouldn’t let me (“ERROR:
Please do not 

SPAM our bug system”), probably because of all the “URLs” I was
trying to post.



Oh well, here’s the comment I tried to post: 

http://paste.pocoo.org/raw/VBO3Gn0vIipLQPRIgAEB/

------------------------------------------------------------------------
[2010-12-05 00:28:50] gunther at keryx dot se

Description:
------------
If an URL uses IDN it should be considered valid.



The test script outputs three blank lines. It should output the URL's.



Examples from http://mathiasbynens.be/demo/url-regex



Test script:
---------------
<?php

echo filter_var('http://✪df.ws/123', FILTER_VALIDATE_URL);

echo "\n";

echo filter_var('http://⌘.ws/', FILTER_VALIDATE_URL);

echo "\n";

echo filter_var('http://➡.ws/䨹', FILTER_VALIDATE_URL);

echo "\n";





Expected result:
----------------
http://✪df.ws/123

http://⌘.ws/

http://⌘.ws/http://➡.ws/䨹





Actual result:
--------------
\n

\n

\n


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53474&edit=1

Reply via email to