|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-09-26 11:25 UTC] 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.
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
While technically true, the fact was that tel: WAS a URL before, and it's still wildly used out there. parse_url("tel:911") should be able to call 911, and not try to connect to port 911 on the tel host.