diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2002-12-30 16:42:49 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2002-12-30 16:42:49 +0000 |
commit | bd19dabefe3a3d25c5c01b5161f70e96255564c5 (patch) | |
tree | 320fc03448e1c7bc66dbf1d77f6f2fdea049813f /ext/standard/url.c | |
parent | d454becda889df68a85c39d5c1f03cc4aa0fc6a9 (diff) | |
download | php-git-bd19dabefe3a3d25c5c01b5161f70e96255564c5.tar.gz |
Fixed bug #21226 (parse_url handling of urls without a path).
Diffstat (limited to 'ext/standard/url.c')
-rw-r--r-- | ext/standard/url.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c index d59f6139cb..be91dffdb0 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -157,12 +157,16 @@ PHPAPI php_url *php_url_parse(char *str) goto nohost; } - if (!(e = strchr(s, '/'))) { - e = ue; - } else if (e && e == s) { - e = ue; - } - + e = ue; + + if (!(p = strchr(s, '/'))) { + if ((p = strchr(s, '?'))) { + e = p; + } + } else { + e = p; + } + /* check for login and password */ if ((p = memchr(s, '@', (e-s)))) { if ((pp = memchr(s, ':', (p-s)))) { |