summaryrefslogtreecommitdiff
path: root/ext/standard/url.c
diff options
context:
space:
mode:
authorJoe Watkins <krakjoe@php.net>2017-06-22 11:52:20 +0100
committerJoe Watkins <krakjoe@php.net>2017-06-22 11:52:39 +0100
commited1f64e0837dbc70496c4b17be24703373871c68 (patch)
tree36dc388a96a2946c2bdd46097c2e65eac14ba69f /ext/standard/url.c
parentc288ed44a22d7cc21c18d67a2a45062fe6de621e (diff)
parentdb287b23030a2ac16bd9e2524d7e8bbe1b4a4d9a (diff)
downloadphp-git-ed1f64e0837dbc70496c4b17be24703373871c68.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: fix bug #74780 parse_url() borken when query string contains colon
Diffstat (limited to 'ext/standard/url.c')
-rw-r--r--ext/standard/url.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c
index be6b0d6c7b..8b491baefc 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -112,6 +112,10 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
if (!isalpha(*p) && !isdigit(*p) && *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 = 0;
+ goto parse_host;
} else {
goto just_path;
}
@@ -208,6 +212,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
goto just_path;
}
+ parse_host:
/* Binary-safe strcspn(s, "/?#") */
e = ue;
if ((p = memchr(s, '/', e - s))) {