|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-02-04 12:18 UTC] aharvey@php.net
Description: ------------ Non-integer port numbers are currently validated as OK by FILTER_VALIDATE_URL, per a comment in bug #53901. Test script: --------------- <?php var_dump(filter_var('http://example.com:qq', FILTER_VALIDATE_URL)); ?> Expected result: ---------------- bool(false) Actual result: -------------- string(21) "http://example.com:qq" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
Thanks. Since this filter uses parse_url() internally, I suggest the easiest fix would be to make parse_url() return FALSE here. Note that parse_url() already does some validation of the port number: parse_url('http://example.com:12345'); // OK parse_url('http://example.com:123456'); // FALSE