diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2011-08-11 13:01:52 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2011-08-11 13:01:52 +0000 |
commit | 78c823067f66de77bb3424b523dc5d7bf242d46a (patch) | |
tree | a2d57c302fb64179fc2124c1cc8cf203de6517af | |
parent | e780e7bfb96cac4e7de6ce7639a85ab86edac232 (diff) | |
download | php-git-78c823067f66de77bb3424b523dc5d7bf242d46a.tar.gz |
Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path)
-rw-r--r-- | ext/standard/tests/url/bug55399.phpt | 10 | ||||
-rw-r--r-- | ext/standard/url.c | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/ext/standard/tests/url/bug55399.phpt b/ext/standard/tests/url/bug55399.phpt new file mode 100644 index 0000000000..619c08da6d --- /dev/null +++ b/ext/standard/tests/url/bug55399.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #55399 (parse_url() incorrectly treats ':' as a valid path) +--FILE-- +<?php + +var_dump(parse_url(":")); + +?> +--EXPECT-- +bool(false) diff --git a/ext/standard/url.c b/ext/standard/url.c index e516f15982..0a1903a22d 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -197,6 +197,10 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) efree(ret); return NULL; } + } else if (p == pp && *pp == '\0') { + STR_FREE(ret->scheme); + efree(ret); + return NULL; } else { goto just_path; } |