Bug #53924 [Com]: FILTER_VALIDATE_URL doesn't validate port numbers

From: Date: Mon, 29 Aug 2011 08:30:31 +0000
Subject: Bug #53924 [Com]: FILTER_VALIDATE_URL doesn't validate port numbers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-163083@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53924&edit=1 ID: 53924 Comment by: Jamesjerseys at 126 dot com Reported by: aharvey@php.net Summary: FILTER_VALIDATE_URL doesn't validate port numbers Status: Closed Type: Bug Package: Filter related Operating System: Irrelevant PHP Version: trunk-SVN-2011-02-04 (SVN) Assigned To: iliaa Block user comment: N Private report: N New Comment: http://www.wholesalenfl-jersey.com/ Wholesale Jerseys Previous Comments: ------------------------------------------------------------------------ [2011-02-04 22:41:22] iliaa@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2011-02-04 22:41:17] iliaa@php.net Automatic comment from SVN on behalf of iliaa Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=308035 Log: Fixed bug #53924 (FILTER_VALIDATE_URL doesn't validate port number). ------------------------------------------------------------------------ [2011-02-04 15:34:31] aaz at althenia dot net 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 ------------------------------------------------------------------------ [2011-02-04 12:18:52] 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" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=53924&edit=1

« previous php.bugs (#163083) next »