summaryrefslogtreecommitdiff
path: root/ext/standard/url.c
diff options
context:
space:
mode:
authorTjerk Meesters <datibbaw@php.net>2015-03-06 20:59:52 +0800
committerTjerk Meesters <datibbaw@php.net>2015-03-06 20:59:52 +0800
commit1236a30746119c3c99754c6c639a134d0e6318d6 (patch)
treea3e4fe5de6af45c40483a2823e48d235e51519d0 /ext/standard/url.c
parent4bc7ee2eb776b05c8794c2c3abb5f995d4ddc8e7 (diff)
parent469b5a9584b1647fdccb37b663dd076ba991d764 (diff)
downloadphp-git-1236a30746119c3c99754c6c639a134d0e6318d6.tar.gz
Merge branch 'PHP-5.6'
* PHP-5.6: Fixed bug #68917 (parse_url fails on some partial urls) Update test to run locally instead of remotely
Diffstat (limited to 'ext/standard/url.c')
-rw-r--r--ext/standard/url.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c
index deb1450ad2..b2ffa3750e 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, size_t length)
port = ZEND_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 {
if (ret->scheme) efree(ret->scheme);
efree(ret);
@@ -201,12 +204,12 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
if (ret->scheme) efree(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: