note 108806 added to function.parse-url

From: Date: Fri, 25 May 2012 15:14:46 +0000
Subject: note 108806 added to function.parse-url
Groups: php.notes 
Request: Send a blank email to php-notes+get-188227@lists.php.net to get a copy of this message
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). ---- Server IP: 208.69.120.55 Probable Submitter: 173.12.33.73 ---- Manual Page -- http://www.php.net/manual/en/function.parse-url.php Edit -- https://master.php.net/note/edit/108806 Del: integrated -- https://master.php.net/note/delete/108806/integrated Del: useless -- https://master.php.net/note/delete/108806/useless Del: bad code -- https://master.php.net/note/delete/108806/bad+code Del: spam -- https://master.php.net/note/delete/108806/spam Del: non-english -- https://master.php.net/note/delete/108806/non-english Del: in docs -- https://master.php.net/note/delete/108806/in+docs Del: other reasons-- https://master.php.net/note/delete/108806 Reject -- https://master.php.net/note/reject/108806 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#188227) next »