|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchestrunk (last revision 2011-05-07 19:26 UTC by dtajchreber@php.net)5_3 (last revision 2011-05-07 19:26 UTC by dtajchreber@php.net) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-04-29 04:13 UTC] dtajchreber@php.net
-Type: Bug
+Type: Feature/Change Request
[2011-04-29 04:13 UTC] dtajchreber@php.net
[2011-05-07 21:26 UTC] dtajchreber@php.net
[2011-05-07 21:26 UTC] dtajchreber@php.net
[2016-01-30 20:48 UTC] narf at devilix dot net
[2020-03-01 23:02 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2020-03-01 23:02 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 21:00:01 2025 UTC |
Description: ------------ I just came to wonder why the filter extension rejects my IPv6 URLs. For example this returns `false` even though it's a valid HTTP url: filter_var("http://[::1]:2000/push/thingy", FILTER_VALIDATE_URL); I'm somewhat certain that FILTER_VALIDATE_URL actually used [`parse_url`](http://php.net/parse_url) behind the scenes to probe for URL correctness. But parse_url itself works perfectly fine on such addresses: Array( [scheme] => http [host] => [::1] [port] => 2000 [path] => /push/thingy So there is some limitation in the filter_var wrapper for _VALIDATE_URL. --- Note that this is a distinct issue to http://bugs.php.net/bug.php?id=48762&edit=2 which was about FILTER_VALIDATE_IP addresses only. Test script: --------------- <?php var_dump(filter_var("http://[::1]/path?qs", FILTER_VALIDATE_URL)); ?> Expected result: ---------------- string(20) "http://[::1]/path?qs" Actual result: -------------- bool(false)