Bug #71960 [Fbk->NoF]: parse_url() return empty query, empty fragment

From: Date: Sun, 24 Apr 2016 04:22:28 +0000
Subject: Bug #71960 [Fbk->NoF]: parse_url() return empty query, empty fragment
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200737@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71960&edit=1 ID: 71960 Updated by: php-bugs@lists.php.net Reported by: whatchildisthis at gmail dot com Summary: parse_url() return empty query, empty fragment -Status: Feedback +Status: No Feedback Type: Bug Package: URL related PHP Version: 7.0.5 Assigned To: jhdxr Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2016-04-15 14:22:40] jhdxr@php.net There are some test cases in parse_url_basic_007.phpt proving that the following cases are worked as expected: 1. http://www.php.net/? ==> no query 2. http://www.php.net:80/?# ==> no query and no fragment and there is nothing indicating query string or frament can be empty(0-length), while the section of authority says it can be empty clearly. So could you give more info to prove that we should phrase empty query or empty fragment? ------------------------------------------------------------------------ [2016-04-04 20:54:44] whatchildisthis at gmail dot com (Edit: Corrected var_export() in test script, not print_r()) Description: ------------ parse_url() returns an index for a 0-length username and 0-length password, but not for a 0-length query or fragment. (http://www.faqs.org/rfcs/rfc3986.html) Test script: --------------- <?php var_export(parse_url("http://example.com"); var_export(parse_url("http://:@example.com?#"); ?> Expected result: ---------------- array ( 'scheme' => 'http', 'host' => 'example.com', )array ( 'scheme' => 'http', 'host' => 'example.com', 'user' => '', 'pass' => '', 'query' => '', 'fragment' => '', ) Actual result: -------------- array ( 'scheme' => 'http', 'host' => 'example.com', )array ( 'scheme' => 'http', 'host' => 'example.com', 'user' => '', 'pass' => '', ) ------------------------------------------------------------------------ [2016-04-04 20:51:55] whatchildisthis at gmail dot com Description: ------------ parse_url() returns an index for a 0-length username and 0-length password, but not for a 0-length query or fragment. (http://www.faqs.org/rfcs/rfc3986.html) Test script: --------------- <?php print_r(parse_url("http://example.com"); print_r(parse_url("http://:@example.com?#"); ?> Expected result: ---------------- array ( 'scheme' => 'http', 'host' => 'example.com', )array ( 'scheme' => 'http', 'host' => 'example.com', 'user' => '', 'pass' => '', 'query' => '', 'fragment' => '', ) Actual result: -------------- array ( 'scheme' => 'http', 'host' => 'example.com', )array ( 'scheme' => 'http', 'host' => 'example.com', 'user' => '', 'pass' => '', ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71960&edit=1

« previous php.bugs (#200737) next »