diff options
author | Tjerk Meesters <datibbaw@php.net> | 2015-03-06 20:51:22 +0800 |
---|---|---|
committer | Tjerk Meesters <datibbaw@php.net> | 2015-03-06 20:51:22 +0800 |
commit | d7fb52ea20aba5c9ef53dfa57af3b62717c9e9e5 (patch) | |
tree | e6091462b517eea8b8c19d8047de7cc1e5065b30 /ext/standard/url.c | |
parent | e892f5382f8b2c652932060f1bd345eee4e59b84 (diff) | |
download | php-git-d7fb52ea20aba5c9ef53dfa57af3b62717c9e9e5.tar.gz |
Fixed bug #68917 (parse_url fails on some partial urls)
Diffstat (limited to 'ext/standard/url.c')
-rw-r--r-- | ext/standard/url.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c index 31b027a98d..2f56d3186d 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -192,6 +192,9 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) port = strtol(port_buf, NULL, 10); if (port > 0 && port <= 65535) { ret->port = (unsigned short) port; + if (*s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ + s += 2; + } } else { STR_FREE(ret->scheme); efree(ret); @@ -201,12 +204,12 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) STR_FREE(ret->scheme); efree(ret); return NULL; - } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ + } else if (*s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ s += 2; } else { goto just_path; } - } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ + } else if (*s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ s += 2; } else { just_path: |