note 108806 rejected from function.parse-url by thiago

From: Date: Thu, 31 May 2012 15:33:53 +0000
Subject: note 108806 rejected from function.parse-url by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-188335@lists.php.net to get a copy of this message
Note Submitter: mfsole at hotmail dot com ---- Currently the parse_url function only recognizes ports from 0-65535. Firstly this isn't really documented on the site. Secondly, while it is true that valid port numbers for http requests are less than 65535 there are other types of URLs which have port numbers that can exceed that limit. This is very common in the SMS world as the port number is used to indicate short code. Here is an example: ctpp://ericsson:78325/?carrier=31003&address=2125551212 I don't see any real benefit to limiting the port number, more over the function appears to arbitrarily rewrite the port number. So the above example gets reported as 12789. Best case scenario would be to just allow numbers of any size. PHP is understood to be loosely type so enforcing type here is inconsistent. At the very least document the behavior on the site (I will add post to the function for others).

« previous php.notes (#188335) next »