Bug->Doc #53901 [Opn]: parse_url() discards invalid port number

From: Date: Tue, 01 Feb 2011 13:18:31 +0000
Subject: Bug->Doc #53901 [Opn]: parse_url() discards invalid port number
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5903@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53901&edit=1 ID: 53901 Updated by: cataphract@php.net Reported by: aaz at althenia dot net Summary: parse_url() discards invalid port number Status: Open -Type: Bug +Type: Documentation Problem Package: URL related PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: Partially bogus, as the documentation says, "parse_url" is not meant to validate URLs. Use the filter extension for that. The second part about it returning an int is true though. Previous Comments: ------------------------------------------------------------------------ [2011-02-01 13:28:17] aaz at althenia dot net Description: ------------ parse_url("http://example.com:qq"); Array ( [scheme] => http [host] => example.com ) The port number "qq" is not included, so based on this output there is no way to determine in later code that the URL was invalid. Relatedly, the port number is returned as an int, while the manual says that every component is returned as a string. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53901&edit=1

« previous php.doc.bugs (#5903) next »