Bug #70588 [Opn->Nab]: tel:nnnn URLs are converted to host+port incorrectly
| From: | requinix@php.net | Date: | Sat, 26 Sep 2015 11:32:59 +0000 |
| Subject: | Bug #70588 [Opn->Nab]: tel:nnnn URLs are converted to host+port incorrectly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-196257@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70588&edit=1
ID: 70588
Updated by: requinix@php.net
Reported by: jcnventura at yahoo dot com
Summary: tel:nnnn URLs are converted to host+port incorrectly
-Status: Open
+Status: Not a bug
Type: Bug
Package: URL related
Operating System: Ubuntu LTS 14.04
PHP Version: 5.6.14RC1
Block user comment: N
Private report: N
New Comment:
tel: is a URI, not a URL, and as the note in parse_url's documentation says,
>This function is intended specifically for the purpose of parsing URLs and not URIs.
Previous Comments:
------------------------------------------------------------------------
[2015-09-26 11:25:47] jcnventura at yahoo dot com
Description:
------------
When calling parse_url with tel:nnnn with n <= 65535, the valid URL according to RFC 3966 gets
converted to a host+port pair. The code in ext/standard/url.c (php_url_parse_ex) should be fixed to
detect the tel schema and not goto parse_port in this case.
Expected result:
----------------
var_export(parse_url("tel:65535"));
array (
'scheme' => 'tel',
'path' => 65535,
)
var_export(parse_url("tel:65536"));
array (
'scheme' => 'tel',
'path' => 65536,
)
var_export(parse_url("tel:6000"));
array (
'scheme' => 'tel',
'path' => 6000,
)
var_export(parse_url("tel:600000"));
array (
'scheme' => 'tel',
'path' => '600000',
)
Actual result:
--------------
var_export(parse_url("tel:65535"));
array (
'host' => 'tel',
'port' => 65535,
)
var_export(parse_url("tel:65536"));
false // Tries to match with a port, but outside range.
var_export(parse_url("tel:6000"));
array (
'host' => 'tel',
'port' => 6000, // Shouldn't be a port !?
)
var_export(parse_url("tel:600000"));
array (
'scheme' => 'tel',
'path' => '600000', // Expected result.
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70588&edit=1