php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #54369
Patch bug54369_tests.patch revision 2011-03-24 15:30 UTC by tomas dot brastavicius at quantum dot lt
Patch parse_url.patch revision 2011-03-24 14:47 UTC by tomas dot brastavicius at quantum dot lt

Patch bug54369_tests.patch for URL related Bug #54369

Patch version 2011-03-24 15:30 UTC

Return to Bug #54369 | Download this patch
Patch Revisions:

Developer: tomas.brastavicius@quantum.lt

Index: ext/standard/tests/url/parse_url_basic_008.phpt
===================================================================
--- ext/standard/tests/url/parse_url_basic_008.phpt	(revision 309653)
+++ ext/standard/tests/url/parse_url_basic_008.phpt	(working copy)
@@ -96,8 +96,8 @@
 --> x://::abc/?   : bool(false)
 --> http://::?   : NULL
 --> x://::6.5   : NULL
---> http://?:/   : NULL
---> http://@?:/   : NULL
+--> http://?:/   : bool(false)
+--> http://@?:/   : bool(false)
 --> file:///:   : NULL
 --> file:///a:/   : NULL
 --> file:///ab:/   : NULL
Index: ext/standard/tests/url/parse_url_basic_009.phpt
===================================================================
--- ext/standard/tests/url/parse_url_basic_009.phpt	(revision 309653)
+++ ext/standard/tests/url/parse_url_basic_009.phpt	(working copy)
@@ -96,8 +96,8 @@
 --> x://::abc/?   : bool(false)
 --> http://::?   : NULL
 --> x://::6.5   : NULL
---> http://?:/   : NULL
---> http://@?:/   : NULL
+--> http://?:/   : bool(false)
+--> http://@?:/   : bool(false)
 --> file:///:   : NULL
 --> file:///a:/   : NULL
 --> file:///ab:/   : NULL
Index: ext/standard/tests/url/parse_url_basic_002.phpt
===================================================================
--- ext/standard/tests/url/parse_url_basic_002.phpt	(revision 309653)
+++ ext/standard/tests/url/parse_url_basic_002.phpt	(working copy)
@@ -97,8 +97,8 @@
 --> x://::abc/?   : bool(false)
 --> http://::?   : string(4) "http"
 --> x://::6.5   : string(1) "x"
---> http://?:/   : string(4) "http"
---> http://@?:/   : string(4) "http"
+--> http://?:/   : bool(false)
+--> http://@?:/   : bool(false)
 --> file:///:   : string(4) "file"
 --> file:///a:/   : string(4) "file"
 --> file:///ab:/   : string(4) "file"
Index: ext/standard/tests/url/parse_url_basic_005.phpt
===================================================================
--- ext/standard/tests/url/parse_url_basic_005.phpt	(revision 309653)
+++ ext/standard/tests/url/parse_url_basic_005.phpt	(working copy)
@@ -96,8 +96,8 @@
 --> x://::abc/?   : bool(false)
 --> http://::?   : NULL
 --> x://::6.5   : NULL
---> http://?:/   : NULL
---> http://@?:/   : string(0) ""
+--> http://?:/   : bool(false)
+--> http://@?:/   : bool(false)
 --> file:///:   : NULL
 --> file:///a:/   : NULL
 --> file:///ab:/   : NULL
Index: ext/standard/tests/url/parse_url_basic_004.phpt
===================================================================
--- ext/standard/tests/url/parse_url_basic_004.phpt	(revision 309653)
+++ ext/standard/tests/url/parse_url_basic_004.phpt	(working copy)
@@ -96,8 +96,8 @@
 --> x://::abc/?   : bool(false)
 --> http://::?   : NULL
 --> x://::6.5   : int(6)
---> http://?:/   : NULL
---> http://@?:/   : NULL
+--> http://?:/   : bool(false)
+--> http://@?:/   : bool(false)
 --> file:///:   : NULL
 --> file:///a:/   : NULL
 --> file:///ab:/   : NULL
Index: ext/standard/tests/url/bug54369.phpt
===================================================================
--- ext/standard/tests/url/bug54369.phpt	(revision 0)
+++ ext/standard/tests/url/bug54369.phpt	(revision 0)
@@ -0,0 +1,47 @@
+--TEST--
+Bug #54180 (parse_url() incorrectly parses path when ? in fragment)
+--FILE--
+<?php
+
+$url = 'http://www.example.com#fra/gment';
+echo $url . "\n";
+var_dump(parse_url($url));
+
+$url = 'http://www.example.com?p=1/param';
+echo $url . "\n";
+var_dump(parse_url($url));
+
+$url = 'http://#fra/gment';
+echo $url . "\n";
+var_dump(parse_url($url));
+
+$url = 'http://?p=1/param';
+echo $url . "\n";
+var_dump(parse_url($url));
+
+
+?>
+--EXPECTF--
+http://www.example.com#fra/gment
+array(3) {
+  ["scheme"]=>
+  string(4) "http"
+  ["host"]=>
+  string(15) "www.example.com"
+  ["fragment"]=>
+  string(9) "fra/gment"
+}
+http://www.example.com?p=1/param
+array(3) {
+  ["scheme"]=>
+  string(4) "http"
+  ["host"]=>
+  string(15) "www.example.com"
+  ["query"]=>
+  string(9) "p=1/param"
+}
+http://#fra/gment
+bool(false)
+http://?p=1/param
+bool(false)
+
Index: ext/standard/tests/url/parse_url_basic_001.phpt
===================================================================
--- ext/standard/tests/url/parse_url_basic_001.phpt	(revision 309653)
+++ ext/standard/tests/url/parse_url_basic_001.phpt	(working copy)
@@ -752,25 +752,9 @@
   int(6)
 }
 
---> http://?:/: array(3) {
-  ["scheme"]=>
-  string(4) "http"
-  ["host"]=>
-  string(1) "?"
-  ["path"]=>
-  string(1) "/"
-}
+--> http://?:/: bool(false)
 
---> http://@?:/: array(4) {
-  ["scheme"]=>
-  string(4) "http"
-  ["host"]=>
-  string(1) "?"
-  ["user"]=>
-  string(0) ""
-  ["path"]=>
-  string(1) "/"
-}
+--> http://@?:/: bool(false)
 
 --> file:///:: array(2) {
   ["scheme"]=>
Index: ext/standard/tests/url/parse_url_basic_007.phpt
===================================================================
--- ext/standard/tests/url/parse_url_basic_007.phpt	(revision 309653)
+++ ext/standard/tests/url/parse_url_basic_007.phpt	(working copy)
@@ -96,8 +96,8 @@
 --> x://::abc/?   : bool(false)
 --> http://::?   : NULL
 --> x://::6.5   : NULL
---> http://?:/   : string(1) "/"
---> http://@?:/   : string(1) "/"
+--> http://?:/   : bool(false)
+--> http://@?:/   : bool(false)
 --> file:///:   : string(2) "/:"
 --> file:///a:/   : string(3) "a:/"
 --> file:///ab:/   : string(5) "/ab:/"
Index: ext/standard/tests/url/parse_url_basic_006.phpt
===================================================================
--- ext/standard/tests/url/parse_url_basic_006.phpt	(revision 309653)
+++ ext/standard/tests/url/parse_url_basic_006.phpt	(working copy)
@@ -96,8 +96,8 @@
 --> x://::abc/?   : bool(false)
 --> http://::?   : NULL
 --> x://::6.5   : NULL
---> http://?:/   : NULL
---> http://@?:/   : NULL
+--> http://?:/   : bool(false)
+--> http://@?:/   : bool(false)
 --> file:///:   : NULL
 --> file:///a:/   : NULL
 --> file:///ab:/   : NULL
Index: ext/standard/tests/url/parse_url_basic_003.phpt
===================================================================
--- ext/standard/tests/url/parse_url_basic_003.phpt	(revision 309653)
+++ ext/standard/tests/url/parse_url_basic_003.phpt	(working copy)
@@ -96,8 +96,8 @@
 --> x://::abc/?   : bool(false)
 --> http://::?   : string(1) ":"
 --> x://::6.5   : string(1) ":"
---> http://?:/   : string(1) "?"
---> http://@?:/   : string(1) "?"
+--> http://?:/   : bool(false)
+--> http://@?:/   : bool(false)
 --> file:///:   : NULL
 --> file:///a:/   : NULL
 --> file:///ab:/   : NULL
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 18 08:03:35 2021 UTC