Bug #70588 [NEW]: tel:nnnn URLs are converted to host+port incorrectly

From: Date: Sat, 26 Sep 2015 11:25:48 +0000
Subject: Bug #70588 [NEW]: tel:nnnn URLs are converted to host+port incorrectly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196256@lists.php.net to get a copy of this message
From: jcnventura at yahoo dot com Operating system: Ubuntu LTS 14.04 PHP version: 5.6.14RC1 Package: URL related Bug Type: Bug Bug description:tel:nnnn URLs are converted to host+port incorrectly 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 bug report at https://bugs.php.net/bug.php?id=70588&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70588&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70588&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70588&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70588&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70588&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70588&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70588&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70588&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70588&r=support Expected behavior: https://bugs.php.net/fix.php?id=70588&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70588&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70588&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70588&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70588&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70588&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70588&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70588&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70588&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70588&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70588&r=mysqlcfg

« previous php.bugs (#196256) next »