-
-
Save fredemmott/39c9abef4571f1e337d339fd8355da60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HG changeset patch | |
# User Fred Emmott <fe@fb.com> | |
# Date 1516900785 28800 | |
# Thu Jan 25 09:19:45 2018 -0800 | |
# Node ID 7071241f53f26aa55646dfc3d4be39c9b9b3a86d | |
# Parent 3eb338306abe3bd7decb7c21d00f48793e9ce800 | |
[hhvm] re-sync parse_url() implementation with upsstream | |
Summary: | |
Re-sync from PHP7 master. | |
This gives us | |
- all bugfixes, not just security bugfixes | |
- an implementation that is widely used and reviewed in the larger community | |
## Changes | |
- hhvm-specific: remove `memchr()` portability workaround | |
- unneccessary: memchr is available on all platforms we support, and was | |
already used in other places in this function | |
- buggy: resulted in `(start - 1)` when no match, instead of `nullptr` | |
- hhvm-specific: remove whitelist for valid characters in usernames/passwords; fixes facebook/hhvm#8104 (wikipedia) | |
- replace string null-terminator checks with pointer/length checks | |
- many more bounds checks | |
Test Plan: unit tests | |
Reviewers: axxu, mwilliams, #secinfrawww | |
Differential Revision: https://phabricator.intern.facebook.com/D6798174 | |
Tasks: T25372156, T20470262 | |
diff --git a/fbcode/hphp/runtime/base/zend-url.cpp b/fbcode/hphp/runtime/base/zend-url.cpp | |
--- a/fbcode/hphp/runtime/base/zend-url.cpp | |
+++ b/fbcode/hphp/runtime/base/zend-url.cpp | |
@@ -3,15 +3,15 @@ | |
| HipHop for PHP | | |
+----------------------------------------------------------------------+ | |
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | | |
- | Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) | | |
+ | Copyright (c) 1997-2018 The PHP Group | | |
+----------------------------------------------------------------------+ | |
- | This source file is subject to version 2.00 of the Zend license, | | |
- | that is bundled with this package in the file LICENSE, and is | | |
+ | This source file is subject to version 3.01 of the PHP license, | | |
+ | that is bundled with this package in the file LICENSE.PHP, and is | | |
| available through the world-wide-web at the following url: | | |
- | http://www.zend.com/license/2_00.txt. | | |
- | If you did not receive a copy of the Zend license and are unable to | | |
+ | http://www.php.net/license/3_01.txt | | |
+ | If you did not receive a copy of the PHP license and are unable to | | |
| obtain it through the world-wide-web, please send a note to | | |
- | license@zend.com so we can mail you a copy immediately. | | |
+ | license@php.net so we can mail you a copy immediately. | | |
+----------------------------------------------------------------------+ | |
*/ | |
@@ -45,13 +45,19 @@ | |
bool url_parse(Url &output, const char *str, size_t length) { | |
char port_buf[6]; | |
+ // s: full string | |
+ // ue: end of full string | |
+ // p: start of string slice we're looking at | |
+ // e: index of something we searched for, e.g. ':'. usually end of string | |
+ // slice, but not always | |
+ // pp: start of string sub-slice | |
const char *s, *e, *p, *pp, *ue; | |
s = str; | |
ue = s + length; | |
/* parse scheme */ | |
- if ((e = (const char *)memchr((const void *)s, ':', length)) && (e - s)) { | |
+ if ((e = (const char *)memchr((const void *)s, ':', length)) && e != s) { | |
/* validate scheme */ | |
p = s; | |
while (p < e) { | |
@@ -60,6 +66,11 @@ | |
*p != '+' && *p != '.' && *p != '-') { | |
if (e + 1 < ue && e < s + strcspn(s, "?#")) { | |
goto parse_port; | |
+ } else if (s + 1 < ue && *s == '/' && *(s + 1) == '/') { | |
+ /* relative-scheme URL */ | |
+ s += 2; | |
+ e = nullptr; | |
+ goto parse_host; | |
} else { | |
goto just_path; | |
} | |
@@ -67,9 +78,9 @@ | |
p++; | |
} | |
- if (*(e + 1) == '\0') { /* only scheme is available */ | |
+ if ((e + 1) == ue) { /* only scheme is available */ | |
replace_controlchars(output.scheme, s, (e - s)); | |
- goto end; | |
+ return true; | |
} | |
/* | |
@@ -81,105 +92,96 @@ | |
* correctly parse things like a.com:80 | |
*/ | |
p = e + 1; | |
- while (isdigit(*p)) { | |
+ while (p < ue && isdigit(*p)) { | |
p++; | |
} | |
- if ((*p == '\0' || *p == '/') && (p - e) < 7) { | |
+ if ((p == ue || *p == '/') && (p - e) < 7) { | |
goto parse_port; | |
} | |
replace_controlchars(output.scheme, s, (e - s)); | |
- length -= ++e - s; | |
- s = e; | |
+ s = e + 1; | |
goto just_path; | |
} else { | |
replace_controlchars(output.scheme, s, (e - s)); | |
- if (*(e+2) == '/') { | |
+ if (e + 2 < ue && *(e+2) == '/') { | |
s = e + 3; | |
if (output.scheme.get()->isame(s_file.get())) { | |
- if (*(e + 3) == '/') { | |
+ if (e + 3 < ue && *(e + 3) == '/') { | |
/* support windows drive letters as in: | |
file:///c:/somedir/file.txt | |
*/ | |
- if (e[4] != '\0' && e[5] == ':') { | |
+ if (e + 5 < ue && e[4] != '\0' && e[5] == ':') { | |
s = e + 4; | |
} | |
- goto nohost; | |
+ goto just_path; | |
} | |
} | |
} else { | |
- if (output.scheme.get()->isame(s_file.get())) { | |
- s = e + 1; | |
- goto nohost; | |
- } else { | |
- length -= ++e - s; | |
- s = e; | |
- goto just_path; | |
- } | |
+ s = e + 1; | |
+ goto just_path; | |
} | |
} | |
- } else if (e) { /* no scheme, look for port */ | |
+ } else if (e) { /* no scheme; starts with colon: look for port */ | |
parse_port: | |
p = e + 1; | |
pp = p; | |
- while (pp-p < 6 && isdigit(*pp)) { | |
+ while (pp < ue && pp - p < 6 && isdigit(*pp)) { | |
pp++; | |
} | |
- if (pp - p > 0 && pp-p < 6 && (*pp == '/' || *pp == '\0')) { | |
+ if (pp - p > 0 && pp - p < 6 && (pp == ue || *pp == '/')) { | |
memcpy(port_buf, p, (pp-p)); | |
port_buf[pp-p] = '\0'; | |
auto port = atoi(port_buf); | |
if (port > 0 && port <= 65535) { | |
output.port = port; | |
- if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ | |
+ if (s + 1 < ue && *s == '/' && *(s+1) == '/') { | |
+ /* relative-scheme URL */ | |
s += 2; | |
} | |
} else { | |
return false; | |
} | |
- } else if (p == pp && *pp == '\0') { | |
+ } else if (p == pp && pp == ue) { | |
return false; | |
- } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ | |
+ } else if (s + 1 < ue && *s == '/' && *(s+1) == '/') { | |
+ /* relative-scheme URL */ | |
s += 2; | |
} else { | |
goto just_path; | |
} | |
- } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ | |
+ } else if (s + 1 < ue && *s == '/' && *(s +1 ) == '/') { | |
+ /* relative-scheme URL */ | |
s += 2; | |
} else { | |
- just_path: | |
- ue = s + length; | |
- goto nohost; | |
+ goto just_path; | |
} | |
- e = s + strcspn(s, "/?#"); | |
+ parse_host: | |
+ /* Binary-safe strcspn(s, "/?#") */ | |
+ e = ue; | |
+ if ((p = (const char*)memchr(s, '/', e - s))) { | |
+ e = p; | |
+ } | |
+ if ((p = (const char*)memchr(s, '?', e - s))) { | |
+ e = p; | |
+ } | |
+ if ((p = (const char*)memchr(s, '#', e - s))) { | |
+ e = p; | |
+ } | |
/* check for login and password */ | |
- if ((p = (const char *)memrchr(s, '@', (e-s)))) { | |
- /* check for invalid chars inside login/pass */ | |
- pp = s; | |
- while (pp < p) { | |
- if (!isalnum(*pp) && *pp != ':' && *pp != ';' && *pp != '=' && | |
- !(*pp >= '!' && *pp <= ',')) { | |
- return false; | |
- } | |
- pp++; | |
- } | |
- | |
- if ((pp = (const char *)memchr(s, ':', (p-s)))) { | |
- if ((pp-s) > 0) { | |
- replace_controlchars(output.user, s, (pp - s)); | |
- } | |
+ if ((p = (const char*)memrchr(s, '@', (e-s)))) { | |
+ if ((pp = (const char*)memchr(s, ':', (p-s)))) { | |
+ replace_controlchars(output.user, s, (pp - s)); | |
pp++; | |
- if (p-pp > 0) { | |
- replace_controlchars(output.pass, pp, (p-pp)); | |
- } | |
+ replace_controlchars(output.pass, pp, (p-pp)); | |
} else { | |
replace_controlchars(output.user, s, (p-s)); | |
} | |
@@ -188,18 +190,16 @@ | |
} | |
/* check for port */ | |
- if (*s == '[' && *(e-1) == ']') { | |
+ if (s < ue && *s == '[' && *(e-1) == ']') { | |
/* Short circuit portscan, | |
we're dealing with an | |
IPv6 embedded address */ | |
- p = s; | |
+ p = nullptr; | |
} else { | |
- /* memrchr is a GNU specific extension | |
- Emulate for wide compatibility */ | |
- for(p = e; *p != ':' && p >= s; p--); | |
+ p = (const char*)memrchr(s, ':', e - s); | |
} | |
- if (p >= s && *p == ':') { | |
+ if (p) { | |
if (!output.port) { | |
p++; | |
if (e-p > 5) { /* port cannot be longer then 5 characters */ | |
@@ -233,47 +233,32 @@ | |
s = e; | |
- nohost: | |
+ just_path: | |
- if ((p = (const char *)memchr(s, '?', (ue - s)))) { | |
- pp = (const char*)memchr(s, '#', (ue - s)); | |
+ e = ue; | |
+ p = (const char*)memchr(s, '#', (e - s)); | |
- if (pp && pp < p) { | |
- if (pp - s) { | |
- replace_controlchars(output.path, s, (pp - s)); | |
- p = pp; | |
- } | |
- goto label_parse; | |
+ if (p) { | |
+ p++; | |
+ if (p < e) { | |
+ replace_controlchars(output.fragment, p, e - p); | |
} | |
- | |
- if (p - s) { | |
- replace_controlchars(output.path, s, (p - s)); | |
- } | |
+ e = p - 1; | |
+ } | |
- if (pp) { | |
- if (pp - ++p) { | |
- replace_controlchars(output.query, p, (pp - p)); | |
- } | |
- p = pp; | |
- goto label_parse; | |
- } else if (++p - ue) { | |
- replace_controlchars(output.query, p, (ue - p)); | |
+ p = (const char*)memchr(s, '?', (e - s)); | |
+ if (p) { | |
+ p++; | |
+ if (p < e) { | |
+ replace_controlchars(output.query, p, e - p); | |
} | |
- } else if ((p = (const char *)memchr(s, '#', (ue - s)))) { | |
- if (p - s) { | |
- replace_controlchars(output.path, s, (p - s)); | |
- } | |
- | |
- label_parse: | |
- p++; | |
+ e = p - 1; | |
+ } | |
- if (ue - p) { | |
- replace_controlchars(output.fragment, p, (ue - p)); | |
- } | |
- } else { | |
- replace_controlchars(output.path, s, (ue - s)); | |
+ if (s < e || s == ue) { | |
+ replace_controlchars(output.path, s, e - s); | |
} | |
-end: | |
+ | |
return true; | |
} | |
diff --git a/fbcode/hphp/test/slow/ext_url/parse_url.php b/fbcode/hphp/test/slow/ext_url/parse_url.php | |
--- a/fbcode/hphp/test/slow/ext_url/parse_url.php | |
+++ b/fbcode/hphp/test/slow/ext_url/parse_url.php | |
@@ -4,3 +4,6 @@ | |
var_dump(parse_url('irc://chat.freenode.net/#hhvm')); | |
var_dump(parse_url('content/:/\*')); | |
var_dump(parse_url("//example.org:8088/sites/default/files/drums.mp3")); | |
+var_dump(parse_url("http://xx23124:__ffdfdef__@www.test.com:12345/dir")); | |
+var_dump(parse_url('127.0.0.1')); | |
+var_dump(parse_url('127.0.0.1:1234')); | |
diff --git a/fbcode/hphp/test/slow/ext_url/parse_url.php.expect b/fbcode/hphp/test/slow/ext_url/parse_url.php.expect | |
--- a/fbcode/hphp/test/slow/ext_url/parse_url.php.expect | |
+++ b/fbcode/hphp/test/slow/ext_url/parse_url.php.expect | |
@@ -40,3 +40,27 @@ | |
["path"]=> | |
string(30) "/sites/default/files/drums.mp3" | |
} | |
+array(6) { | |
+ ["scheme"]=> | |
+ string(4) "http" | |
+ ["host"]=> | |
+ string(12) "www.test.com" | |
+ ["port"]=> | |
+ int(12345) | |
+ ["user"]=> | |
+ string(7) "xx23124" | |
+ ["pass"]=> | |
+ string(11) "__ffdfdef__" | |
+ ["path"]=> | |
+ string(4) "/dir" | |
+} | |
+array(1) { | |
+ ["path"]=> | |
+ string(9) "127.0.0.1" | |
+} | |
+array(2) { | |
+ ["host"]=> | |
+ string(9) "127.0.0.1" | |
+ ["port"]=> | |
+ int(1234) | |
+} | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/strings/url_t.php b/fbcode/hphp/test/zend/good/ext/standard/tests/strings/url_t.php | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/strings/url_t.php | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/strings/url_t.php | |
@@ -72,6 +72,7 @@ | |
); | |
foreach ($sample_urls as $url) { | |
+ echo "\n--> $url: "; | |
var_dump(@parse_url($url)); | |
} | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/strings/url_t.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/strings/url_t.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/strings/url_t.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/strings/url_t.php.expectf | |
@@ -1,18 +1,21 @@ | |
-array(1) { | |
+--> : array(1) { | |
["path"]=> | |
string(0) "" | |
} | |
-array(1) { | |
+ | |
+--> 64.246.30.37: array(1) { | |
["path"]=> | |
string(12) "64.246.30.37" | |
} | |
-array(2) { | |
+ | |
+--> http://64.246.30.37: array(2) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
string(12) "64.246.30.37" | |
} | |
-array(3) { | |
+ | |
+--> http://64.246.30.37/: array(3) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -20,11 +23,13 @@ | |
["path"]=> | |
string(1) "/" | |
} | |
-array(1) { | |
+ | |
+--> 64.246.30.37/: array(1) { | |
["path"]=> | |
string(13) "64.246.30.37/" | |
} | |
-array(3) { | |
+ | |
+--> 64.246.30.37:80/: array(3) { | |
["host"]=> | |
string(12) "64.246.30.37" | |
["port"]=> | |
@@ -32,21 +37,25 @@ | |
["path"]=> | |
string(1) "/" | |
} | |
-array(1) { | |
+ | |
+--> php.net: array(1) { | |
["path"]=> | |
string(7) "php.net" | |
} | |
-array(1) { | |
+ | |
+--> php.net/: array(1) { | |
["path"]=> | |
string(8) "php.net/" | |
} | |
-array(2) { | |
+ | |
+--> http://php.net: array(2) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
string(7) "php.net" | |
} | |
-array(3) { | |
+ | |
+--> http://php.net/: array(3) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -54,21 +63,25 @@ | |
["path"]=> | |
string(1) "/" | |
} | |
-array(1) { | |
+ | |
+--> www.php.net: array(1) { | |
["path"]=> | |
string(11) "www.php.net" | |
} | |
-array(1) { | |
+ | |
+--> www.php.net/: array(1) { | |
["path"]=> | |
string(12) "www.php.net/" | |
} | |
-array(2) { | |
+ | |
+--> http://www.php.net: array(2) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
string(11) "www.php.net" | |
} | |
-array(3) { | |
+ | |
+--> http://www.php.net/: array(3) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -76,13 +89,15 @@ | |
["path"]=> | |
string(1) "/" | |
} | |
-array(2) { | |
+ | |
+--> www.php.net:80: array(2) { | |
["host"]=> | |
string(11) "www.php.net" | |
["port"]=> | |
int(80) | |
} | |
-array(3) { | |
+ | |
+--> http://www.php.net:80: array(3) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -90,7 +105,8 @@ | |
["port"]=> | |
int(80) | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -100,7 +116,8 @@ | |
["path"]=> | |
string(1) "/" | |
} | |
-array(3) { | |
+ | |
+--> http://www.php.net/index.php: array(3) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -108,11 +125,13 @@ | |
["path"]=> | |
string(10) "/index.php" | |
} | |
-array(1) { | |
+ | |
+--> www.php.net/?: array(1) { | |
["path"]=> | |
string(12) "www.php.net/" | |
} | |
-array(3) { | |
+ | |
+--> www.php.net:80/?: array(3) { | |
["host"]=> | |
string(11) "www.php.net" | |
["port"]=> | |
@@ -120,7 +139,8 @@ | |
["path"]=> | |
string(1) "/" | |
} | |
-array(3) { | |
+ | |
+--> http://www.php.net/?: array(3) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -128,7 +148,8 @@ | |
["path"]=> | |
string(1) "/" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/?: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -138,7 +159,8 @@ | |
["path"]=> | |
string(1) "/" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/index.php: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -148,7 +170,8 @@ | |
["path"]=> | |
string(10) "/index.php" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/foo/bar/index.php: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -158,7 +181,8 @@ | |
["path"]=> | |
string(18) "/foo/bar/index.php" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -168,7 +192,8 @@ | |
["path"]=> | |
string(53) "/this/is/a/very/deep/directory/structure/and/file.php" | |
} | |
-array(5) { | |
+ | |
+--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5: array(5) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -180,7 +205,8 @@ | |
["query"]=> | |
string(37) "lots=1&of=2¶meters=3&too=4&here=5" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -190,7 +216,8 @@ | |
["path"]=> | |
string(45) "/this/is/a/very/deep/directory/structure/and/" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -200,7 +227,8 @@ | |
["path"]=> | |
string(53) "/this/is/a/very/deep/directory/structure/and/file.php" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/this/../a/../deep/directory: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -210,7 +238,8 @@ | |
["path"]=> | |
string(28) "/this/../a/../deep/directory" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/this/../a/../deep/directory/: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -220,7 +249,8 @@ | |
["path"]=> | |
string(29) "/this/../a/../deep/directory/" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/this/is/a/very/deep/directory/../file.php: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -230,7 +260,8 @@ | |
["path"]=> | |
string(42) "/this/is/a/very/deep/directory/../file.php" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/index.php: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -240,7 +271,8 @@ | |
["path"]=> | |
string(10) "/index.php" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/index.php?: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -250,7 +282,8 @@ | |
["path"]=> | |
string(10) "/index.php" | |
} | |
-array(5) { | |
+ | |
+--> http://www.php.net:80/#foo: array(5) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -262,7 +295,8 @@ | |
["fragment"]=> | |
string(3) "foo" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net:80/?#: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -272,7 +306,8 @@ | |
["path"]=> | |
string(1) "/" | |
} | |
-array(5) { | |
+ | |
+--> http://www.php.net:80/?test=1: array(5) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -284,7 +319,8 @@ | |
["query"]=> | |
string(6) "test=1" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net/?test=1&: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -294,7 +330,8 @@ | |
["query"]=> | |
string(7) "test=1&" | |
} | |
-array(5) { | |
+ | |
+--> http://www.php.net:80/?&: array(5) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -306,7 +343,8 @@ | |
["query"]=> | |
string(1) "&" | |
} | |
-array(5) { | |
+ | |
+--> http://www.php.net:80/index.php?test=1&: array(5) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -318,7 +356,8 @@ | |
["query"]=> | |
string(7) "test=1&" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net/index.php?&: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -328,7 +367,8 @@ | |
["query"]=> | |
string(1) "&" | |
} | |
-array(5) { | |
+ | |
+--> http://www.php.net:80/index.php?foo&: array(5) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -340,7 +380,8 @@ | |
["query"]=> | |
string(4) "foo&" | |
} | |
-array(4) { | |
+ | |
+--> http://www.php.net/index.php?&foo: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -350,7 +391,8 @@ | |
["query"]=> | |
string(4) "&foo" | |
} | |
-array(5) { | |
+ | |
+--> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI: array(5) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -362,7 +404,8 @@ | |
["query"]=> | |
string(31) "test=1&test2=char&test3=mixesCI" | |
} | |
-array(5) { | |
+ | |
+--> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(5) { | |
["host"]=> | |
string(11) "www.php.net" | |
["port"]=> | |
@@ -374,7 +417,8 @@ | |
["fragment"]=> | |
string(16) "some_page_ref123" | |
} | |
-array(7) { | |
+ | |
+--> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -390,13 +434,16 @@ | |
["fragment"]=> | |
string(16) "some_page_ref123" | |
} | |
-array(6) { | |
+ | |
+--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
string(11) "www.php.net" | |
["user"]=> | |
string(6) "secret" | |
+ ["pass"]=> | |
+ string(0) "" | |
["path"]=> | |
string(10) "/index.php" | |
["query"]=> | |
@@ -404,13 +451,16 @@ | |
["fragment"]=> | |
string(16) "some_page_ref123" | |
} | |
-array(7) { | |
+ | |
+--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
string(11) "www.php.net" | |
["port"]=> | |
int(80) | |
+ ["user"]=> | |
+ string(0) "" | |
["pass"]=> | |
string(7) "hideout" | |
["path"]=> | |
@@ -420,7 +470,8 @@ | |
["fragment"]=> | |
string(16) "some_page_ref123" | |
} | |
-array(7) { | |
+ | |
+--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -436,8 +487,25 @@ | |
["fragment"]=> | |
string(16) "some_page_ref123" | |
} | |
-bool(false) | |
-array(8) { | |
+ | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { | |
+ ["scheme"]=> | |
+ string(4) "http" | |
+ ["host"]=> | |
+ string(11) "www.php.net" | |
+ ["port"]=> | |
+ int(80) | |
+ ["user"]=> | |
+ string(14) "secret@hideout" | |
+ ["path"]=> | |
+ string(10) "/index.php" | |
+ ["query"]=> | |
+ string(31) "test=1&test2=char&test3=mixesCI" | |
+ ["fragment"]=> | |
+ string(16) "some_page_ref123" | |
+} | |
+ | |
+--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -455,13 +523,15 @@ | |
["fragment"]=> | |
string(16) "some_page_ref123" | |
} | |
-array(2) { | |
+ | |
+--> nntp://news.php.net: array(2) { | |
["scheme"]=> | |
string(4) "nntp" | |
["host"]=> | |
string(12) "news.php.net" | |
} | |
-array(3) { | |
+ | |
+--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz: array(3) { | |
["scheme"]=> | |
string(3) "ftp" | |
["host"]=> | |
@@ -469,25 +539,29 @@ | |
["path"]=> | |
string(22) "/gnu/glic/glibc.tar.gz" | |
} | |
-array(2) { | |
+ | |
+--> zlib:http://foo@bar: array(2) { | |
["scheme"]=> | |
string(4) "zlib" | |
["path"]=> | |
string(14) "http://foo@bar" | |
} | |
-array(2) { | |
+ | |
+--> zlib:filename.txt: array(2) { | |
["scheme"]=> | |
string(4) "zlib" | |
["path"]=> | |
string(12) "filename.txt" | |
} | |
-array(2) { | |
+ | |
+--> zlib:/path/to/my/file/file.txt: array(2) { | |
["scheme"]=> | |
string(4) "zlib" | |
["path"]=> | |
string(25) "/path/to/my/file/file.txt" | |
} | |
-array(3) { | |
+ | |
+--> foo://foo@bar: array(3) { | |
["scheme"]=> | |
string(3) "foo" | |
["host"]=> | |
@@ -495,25 +569,29 @@ | |
["user"]=> | |
string(3) "foo" | |
} | |
-array(2) { | |
+ | |
+--> mailto:me@mydomain.com: array(2) { | |
["scheme"]=> | |
string(6) "mailto" | |
["path"]=> | |
string(15) "me@mydomain.com" | |
} | |
-array(2) { | |
+ | |
+--> /foo.php?a=b&c=d: array(2) { | |
["path"]=> | |
string(8) "/foo.php" | |
["query"]=> | |
string(7) "a=b&c=d" | |
} | |
-array(2) { | |
+ | |
+--> foo.php?a=b&c=d: array(2) { | |
["path"]=> | |
string(7) "foo.php" | |
["query"]=> | |
string(7) "a=b&c=d" | |
} | |
-array(6) { | |
+ | |
+--> http://user:passwd@www.example.com:8080?bar=1&boom=0: array(6) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -527,13 +605,15 @@ | |
["query"]=> | |
string(12) "bar=1&boom=0" | |
} | |
-array(2) { | |
+ | |
+--> file:///path/to/file: array(2) { | |
["scheme"]=> | |
string(4) "file" | |
["path"]=> | |
string(13) "/path/to/file" | |
} | |
-array(3) { | |
+ | |
+--> file://path/to/file: array(3) { | |
["scheme"]=> | |
string(4) "file" | |
["host"]=> | |
@@ -541,13 +621,15 @@ | |
["path"]=> | |
string(8) "/to/file" | |
} | |
-array(2) { | |
+ | |
+--> file:/path/to/file: array(2) { | |
["scheme"]=> | |
string(4) "file" | |
["path"]=> | |
string(13) "/path/to/file" | |
} | |
-array(4) { | |
+ | |
+--> http://1.2.3.4:/abc.asp?a=1&b=2: array(4) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -557,7 +639,8 @@ | |
["query"]=> | |
string(7) "a=1&b=2" | |
} | |
-array(3) { | |
+ | |
+--> http://foo.com#bar: array(3) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
@@ -565,11 +648,13 @@ | |
["fragment"]=> | |
string(3) "bar" | |
} | |
-array(1) { | |
+ | |
+--> scheme:: array(1) { | |
["scheme"]=> | |
string(6) "scheme" | |
} | |
-array(4) { | |
+ | |
+--> foo+bar://baz@bang/bla: array(4) { | |
["scheme"]=> | |
string(7) "foo+bar" | |
["host"]=> | |
@@ -579,13 +664,30 @@ | |
["path"]=> | |
string(4) "/bla" | |
} | |
-array(2) { | |
+ | |
+--> gg:9130731: array(2) { | |
["scheme"]=> | |
string(2) "gg" | |
["path"]=> | |
string(7) "9130731" | |
} | |
-bool(false) | |
+ | |
+--> http://user:@pass@host/path?argument?value#etc: array(7) { | |
+ ["scheme"]=> | |
+ string(4) "http" | |
+ ["host"]=> | |
+ string(4) "host" | |
+ ["user"]=> | |
+ string(4) "user" | |
+ ["pass"]=> | |
+ string(5) "@pass" | |
+ ["path"]=> | |
+ string(5) "/path" | |
+ ["query"]=> | |
+ string(14) "argument?value" | |
+ ["fragment"]=> | |
+ string(3) "etc" | |
+} | |
string(4) "http" | |
string(11) "www.php.net" | |
int(80) | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_001.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_001.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_001.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_001.php.expectf | |
@@ -430,13 +430,15 @@ | |
string(16) "some_page_ref123" | |
} | |
---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(6) { | |
+--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
string(11) "www.php.net" | |
["user"]=> | |
string(6) "secret" | |
+ ["pass"]=> | |
+ string(0) "" | |
["path"]=> | |
string(10) "/index.php" | |
["query"]=> | |
@@ -445,13 +447,15 @@ | |
string(16) "some_page_ref123" | |
} | |
---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { | |
+--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { | |
["scheme"]=> | |
string(4) "http" | |
["host"]=> | |
string(11) "www.php.net" | |
["port"]=> | |
int(80) | |
+ ["user"]=> | |
+ string(0) "" | |
["pass"]=> | |
string(7) "hideout" | |
["path"]=> | |
@@ -479,6 +483,23 @@ | |
string(16) "some_page_ref123" | |
} | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { | |
+ ["scheme"]=> | |
+ string(4) "http" | |
+ ["host"]=> | |
+ string(11) "www.php.net" | |
+ ["port"]=> | |
+ int(80) | |
+ ["user"]=> | |
+ string(14) "secret@hideout" | |
+ ["path"]=> | |
+ string(10) "/index.php" | |
+ ["query"]=> | |
+ string(31) "test=1&test2=char&test3=mixesCI" | |
+ ["fragment"]=> | |
+ string(16) "some_page_ref123" | |
+} | |
+ | |
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { | |
["scheme"]=> | |
string(4) "http" | |
@@ -580,6 +601,21 @@ | |
string(12) "bar=1&boom=0" | |
} | |
+--> http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0: array(6) { | |
+ ["scheme"]=> | |
+ string(4) "http" | |
+ ["host"]=> | |
+ string(15) "www.example.com" | |
+ ["port"]=> | |
+ int(8080) | |
+ ["user"]=> | |
+ string(11) "user_me-you" | |
+ ["pass"]=> | |
+ string(11) "my_pas-word" | |
+ ["query"]=> | |
+ string(12) "bar=1&boom=0" | |
+} | |
+ | |
--> file:///path/to/file: array(2) { | |
["scheme"]=> | |
string(4) "file" | |
@@ -646,6 +682,23 @@ | |
string(7) "9130731" | |
} | |
+--> http://user:@pass@host/path?argument?value#etc: array(7) { | |
+ ["scheme"]=> | |
+ string(4) "http" | |
+ ["host"]=> | |
+ string(4) "host" | |
+ ["user"]=> | |
+ string(4) "user" | |
+ ["pass"]=> | |
+ string(5) "@pass" | |
+ ["path"]=> | |
+ string(5) "/path" | |
+ ["query"]=> | |
+ string(14) "argument?value" | |
+ ["fragment"]=> | |
+ string(3) "etc" | |
+} | |
+ | |
--> http://10.10.10.10/:80: array(3) { | |
["scheme"]=> | |
string(4) "http" | |
@@ -805,10 +858,4 @@ | |
--> http://blah.com:123456: bool(false) | |
--> http://blah.com:abcdef: bool(false) | |
- | |
---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: bool(false) | |
- | |
---> http://user:@pass@host/path?argument?value#etc: bool(false) | |
- | |
---> http://foo.com\@bar.com: bool(false) | |
Done | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_002.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_002.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_002.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_002.php.expectf | |
@@ -45,6 +45,7 @@ | |
--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" | |
--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" | |
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" | |
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(4) "http" | |
--> nntp://news.php.net : string(4) "nntp" | |
--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(3) "ftp" | |
@@ -56,6 +57,7 @@ | |
--> /foo.php?a=b&c=d : NULL | |
--> foo.php?a=b&c=d : NULL | |
--> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(4) "http" | |
+--> http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0 : string(4) "http" | |
--> file:///path/to/file : string(4) "file" | |
--> file://path/to/file : string(4) "file" | |
--> file:/path/to/file : string(4) "file" | |
@@ -64,6 +66,7 @@ | |
--> scheme: : string(6) "scheme" | |
--> foo+bar://baz@bang/bla : string(7) "foo+bar" | |
--> gg:9130731 : string(2) "gg" | |
+--> http://user:@pass@host/path?argument?value#etc : string(4) "http" | |
--> http://10.10.10.10/:80 : string(4) "http" | |
--> http://x:? : string(4) "http" | |
--> x:blah.com : string(1) "x" | |
@@ -99,7 +102,4 @@ | |
--> http://:? : bool(false) | |
--> http://blah.com:123456 : bool(false) | |
--> http://blah.com:abcdef : bool(false) | |
---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : bool(false) | |
---> http://user:@pass@host/path?argument?value#etc : bool(false) | |
---> http://foo.com\@bar.com : bool(false) | |
Done | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_003.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_003.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_003.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_003.php.expectf | |
@@ -45,6 +45,7 @@ | |
--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" | |
--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" | |
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" | |
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(11) "www.php.net" | |
--> nntp://news.php.net : string(12) "news.php.net" | |
--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(11) "ftp.gnu.org" | |
@@ -56,6 +57,7 @@ | |
--> /foo.php?a=b&c=d : NULL | |
--> foo.php?a=b&c=d : NULL | |
--> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(15) "www.example.com" | |
+--> http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0 : string(15) "www.example.com" | |
--> file:///path/to/file : NULL | |
--> file://path/to/file : string(4) "path" | |
--> file:/path/to/file : NULL | |
@@ -64,6 +66,7 @@ | |
--> scheme: : NULL | |
--> foo+bar://baz@bang/bla : string(4) "bang" | |
--> gg:9130731 : NULL | |
+--> http://user:@pass@host/path?argument?value#etc : string(4) "host" | |
--> http://10.10.10.10/:80 : string(11) "10.10.10.10" | |
--> http://x:? : string(1) "x" | |
--> x:blah.com : NULL | |
@@ -99,7 +102,4 @@ | |
--> http://:? : bool(false) | |
--> http://blah.com:123456 : bool(false) | |
--> http://blah.com:abcdef : bool(false) | |
---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : bool(false) | |
---> http://user:@pass@host/path?argument?value#etc : bool(false) | |
---> http://foo.com\@bar.com : bool(false) | |
Done | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_004.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_004.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_004.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_004.php.expectf | |
@@ -45,6 +45,7 @@ | |
--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL | |
--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) | |
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) | |
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : int(80) | |
--> nntp://news.php.net : NULL | |
--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL | |
@@ -56,6 +57,7 @@ | |
--> /foo.php?a=b&c=d : NULL | |
--> foo.php?a=b&c=d : NULL | |
--> http://user:passwd@www.example.com:8080?bar=1&boom=0 : int(8080) | |
+--> http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0 : int(8080) | |
--> file:///path/to/file : NULL | |
--> file://path/to/file : NULL | |
--> file:/path/to/file : NULL | |
@@ -64,6 +66,7 @@ | |
--> scheme: : NULL | |
--> foo+bar://baz@bang/bla : NULL | |
--> gg:9130731 : NULL | |
+--> http://user:@pass@host/path?argument?value#etc : NULL | |
--> http://10.10.10.10/:80 : NULL | |
--> http://x:? : NULL | |
--> x:blah.com : NULL | |
@@ -99,7 +102,4 @@ | |
--> http://:? : bool(false) | |
--> http://blah.com:123456 : bool(false) | |
--> http://blah.com:abcdef : bool(false) | |
---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : bool(false) | |
---> http://user:@pass@host/path?argument?value#etc : bool(false) | |
---> http://foo.com\@bar.com : bool(false) | |
Done | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_005.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_005.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_005.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_005.php.expectf | |
@@ -43,8 +43,9 @@ | |
--> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL | |
--> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" | |
--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" | |
---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL | |
+--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(0) "" | |
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(14) "secret@hideout" | |
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" | |
--> nntp://news.php.net : NULL | |
--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL | |
@@ -56,6 +57,7 @@ | |
--> /foo.php?a=b&c=d : NULL | |
--> foo.php?a=b&c=d : NULL | |
--> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(4) "user" | |
+--> http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0 : string(11) "user_me-you" | |
--> file:///path/to/file : NULL | |
--> file://path/to/file : NULL | |
--> file:/path/to/file : NULL | |
@@ -64,6 +66,7 @@ | |
--> scheme: : NULL | |
--> foo+bar://baz@bang/bla : string(3) "baz" | |
--> gg:9130731 : NULL | |
+--> http://user:@pass@host/path?argument?value#etc : string(4) "user" | |
--> http://10.10.10.10/:80 : NULL | |
--> http://x:? : NULL | |
--> x:blah.com : NULL | |
@@ -99,7 +102,4 @@ | |
--> http://:? : bool(false) | |
--> http://blah.com:123456 : bool(false) | |
--> http://blah.com:abcdef : bool(false) | |
---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : bool(false) | |
---> http://user:@pass@host/path?argument?value#etc : bool(false) | |
---> http://foo.com\@bar.com : bool(false) | |
Done | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_006.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_006.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_006.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_006.php.expectf | |
@@ -42,9 +42,10 @@ | |
--> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL | |
--> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL | |
--> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL | |
---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL | |
+--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(0) "" | |
--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" | |
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL | |
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hid:out" | |
--> nntp://news.php.net : NULL | |
--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL | |
@@ -56,6 +57,7 @@ | |
--> /foo.php?a=b&c=d : NULL | |
--> foo.php?a=b&c=d : NULL | |
--> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(6) "passwd" | |
+--> http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0 : string(11) "my_pas-word" | |
--> file:///path/to/file : NULL | |
--> file://path/to/file : NULL | |
--> file:/path/to/file : NULL | |
@@ -64,6 +66,7 @@ | |
--> scheme: : NULL | |
--> foo+bar://baz@bang/bla : NULL | |
--> gg:9130731 : NULL | |
+--> http://user:@pass@host/path?argument?value#etc : string(5) "@pass" | |
--> http://10.10.10.10/:80 : NULL | |
--> http://x:? : NULL | |
--> x:blah.com : NULL | |
@@ -99,7 +102,4 @@ | |
--> http://:? : bool(false) | |
--> http://blah.com:123456 : bool(false) | |
--> http://blah.com:abcdef : bool(false) | |
---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : bool(false) | |
---> http://user:@pass@host/path?argument?value#etc : bool(false) | |
---> http://foo.com\@bar.com : bool(false) | |
Done | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_007.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_007.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_007.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_007.php.expectf | |
@@ -45,6 +45,7 @@ | |
--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" | |
--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" | |
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" | |
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(10) "/index.php" | |
--> nntp://news.php.net : NULL | |
--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : string(22) "/gnu/glic/glibc.tar.gz" | |
@@ -56,6 +57,7 @@ | |
--> /foo.php?a=b&c=d : string(8) "/foo.php" | |
--> foo.php?a=b&c=d : string(7) "foo.php" | |
--> http://user:passwd@www.example.com:8080?bar=1&boom=0 : NULL | |
+--> http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0 : NULL | |
--> file:///path/to/file : string(13) "/path/to/file" | |
--> file://path/to/file : string(8) "/to/file" | |
--> file:/path/to/file : string(13) "/path/to/file" | |
@@ -64,6 +66,7 @@ | |
--> scheme: : NULL | |
--> foo+bar://baz@bang/bla : string(4) "/bla" | |
--> gg:9130731 : string(7) "9130731" | |
+--> http://user:@pass@host/path?argument?value#etc : string(5) "/path" | |
--> http://10.10.10.10/:80 : string(4) "/:80" | |
--> http://x:? : NULL | |
--> x:blah.com : string(8) "blah.com" | |
@@ -99,7 +102,4 @@ | |
--> http://:? : bool(false) | |
--> http://blah.com:123456 : bool(false) | |
--> http://blah.com:abcdef : bool(false) | |
---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : bool(false) | |
---> http://user:@pass@host/path?argument?value#etc : bool(false) | |
---> http://foo.com\@bar.com : bool(false) | |
Done | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_008.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_008.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_008.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_008.php.expectf | |
@@ -45,6 +45,7 @@ | |
--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" | |
--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" | |
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" | |
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(31) "test=1&test2=char&test3=mixesCI" | |
--> nntp://news.php.net : NULL | |
--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL | |
@@ -56,6 +57,7 @@ | |
--> /foo.php?a=b&c=d : string(7) "a=b&c=d" | |
--> foo.php?a=b&c=d : string(7) "a=b&c=d" | |
--> http://user:passwd@www.example.com:8080?bar=1&boom=0 : string(12) "bar=1&boom=0" | |
+--> http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0 : string(12) "bar=1&boom=0" | |
--> file:///path/to/file : NULL | |
--> file://path/to/file : NULL | |
--> file:/path/to/file : NULL | |
@@ -64,6 +66,7 @@ | |
--> scheme: : NULL | |
--> foo+bar://baz@bang/bla : NULL | |
--> gg:9130731 : NULL | |
+--> http://user:@pass@host/path?argument?value#etc : string(14) "argument?value" | |
--> http://10.10.10.10/:80 : NULL | |
--> http://x:? : NULL | |
--> x:blah.com : NULL | |
@@ -99,7 +102,4 @@ | |
--> http://:? : bool(false) | |
--> http://blah.com:123456 : bool(false) | |
--> http://blah.com:abcdef : bool(false) | |
---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : bool(false) | |
---> http://user:@pass@host/path?argument?value#etc : bool(false) | |
---> http://foo.com\@bar.com : bool(false) | |
Done | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_009.php.expectf b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_009.php.expectf | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_009.php.expectf | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/parse_url_basic_009.php.expectf | |
@@ -45,6 +45,7 @@ | |
--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" | |
--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" | |
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" | |
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" | |
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(16) "some_page_ref123" | |
--> nntp://news.php.net : NULL | |
--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz : NULL | |
@@ -56,6 +57,7 @@ | |
--> /foo.php?a=b&c=d : NULL | |
--> foo.php?a=b&c=d : NULL | |
--> http://user:passwd@www.example.com:8080?bar=1&boom=0 : NULL | |
+--> http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0 : NULL | |
--> file:///path/to/file : NULL | |
--> file://path/to/file : NULL | |
--> file:/path/to/file : NULL | |
@@ -64,6 +66,7 @@ | |
--> scheme: : NULL | |
--> foo+bar://baz@bang/bla : NULL | |
--> gg:9130731 : NULL | |
+--> http://user:@pass@host/path?argument?value#etc : string(3) "etc" | |
--> http://10.10.10.10/:80 : NULL | |
--> http://x:? : NULL | |
--> x:blah.com : NULL | |
@@ -99,7 +102,4 @@ | |
--> http://:? : bool(false) | |
--> http://blah.com:123456 : bool(false) | |
--> http://blah.com:abcdef : bool(false) | |
---> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : bool(false) | |
---> http://user:@pass@host/path?argument?value#etc : bool(false) | |
---> http://foo.com\@bar.com : bool(false) | |
Done | |
\ No newline at end of file | |
diff --git a/fbcode/hphp/test/zend/good/ext/standard/tests/url/urls.inc b/fbcode/hphp/test/zend/good/ext/standard/tests/url/urls.inc | |
--- a/fbcode/hphp/test/zend/good/ext/standard/tests/url/urls.inc | |
+++ b/fbcode/hphp/test/zend/good/ext/standard/tests/url/urls.inc | |
@@ -48,6 +48,7 @@ | |
'http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', | |
'http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', | |
'http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', | |
+'http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', | |
'http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', | |
'nntp://news.php.net', | |
'ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz', | |
@@ -59,6 +60,7 @@ | |
'/foo.php?a=b&c=d', | |
'foo.php?a=b&c=d', | |
'http://user:passwd@www.example.com:8080?bar=1&boom=0', | |
+'http://user_me-you:my_pas-word@www.example.com:8080?bar=1&boom=0', | |
'file:///path/to/file', | |
'file://path/to/file', | |
'file:/path/to/file', | |
@@ -67,6 +69,7 @@ | |
'scheme:', | |
'foo+bar://baz@bang/bla', | |
'gg:9130731', | |
+'http://user:@pass@host/path?argument?value#etc', | |
'http://10.10.10.10/:80', | |
'http://x:?', | |
'x:blah.com', | |
@@ -104,9 +107,6 @@ | |
'http://:?', | |
'http://blah.com:123456', | |
'http://blah.com:abcdef', | |
-'http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123', | |
-'http://user:@pass@host/path?argument?value#etc', | |
-'http://foo.com\\@bar.com' | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment