note 122205 deleted from function.parse-url by cmb

From: Date: Sun, 06 Oct 2019 08:16:38 +0000
Subject: note 122205 deleted from function.parse-url by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-212504@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- This function will attempt to parse relative URLs but relaying on it can produce unexpected behavior that can cause some hard to track bugs. (The following results are obtained from PHP 5.5.19) Attempting to parse a url like this http://example.com/entities/GOA:98/?search=8989157d1f22 Correctly produces <?php array ( 'scheme' => 'http', 'host' => 'example.com', 'path' => '/entities/GOA:98/', 'query' => 'search=8989157d1f22', ); ?> However, Attempting to parse the relative URL entities/GOA:98/?search=8989157d1f22 <?php array ( 'host' => 'entities', 'port' => 98, 'path' => '/GOA:98/', 'query' => 'search=8989157d1f22', ) ?> If I change :98 to :A98 parse_url parses the URL correctly as <?php array ( 'path' => 'entities/GOA:A98/', 'query' => 'search=8989157d1f22', ) ?> https://hawacastle.com

« previous php.notes (#212504) next »