]> granicus.if.org Git - php/commit
Fix #69976: Unable to parse "all" urls with colon char
authorChristoph M. Becker <cmb@php.net>
Wed, 1 Jul 2015 21:45:52 +0000 (23:45 +0200)
committerChristoph M. Becker <cmb@php.net>
Wed, 1 Jul 2015 21:48:16 +0000 (23:48 +0200)
commite49922d3f8060e47f810a24ce48d4e622b493699
tree0cead8aa9102aa033a9d4bb757afedccb0d806c3
parent6daed13c8bc29391e6a9f8c4692a69e13ac8c085
Fix #69976: Unable to parse "all" urls with colon char

If a colon occurs in a query string or fragment of a partial URL without
scheme, parse_url() tries to regard it as port separator. If up to 5 digits
follow and then a slash or the end of the string, parse_url() fails.

We're fixing this by checking whether the colon is part of the query string or
the fragment, under the assumption that question marks and hash signs are only
allowed as separators of query string and fragments, respectively, what is
guarenteed for URIs (RFC 3986), but not necessarily for URLs (RFC 1738) where
question marks are allowed for usernames and passwords.

Anyhow, this constitutes a minor BC, so the fix is applied to master only.
ext/standard/tests/url/bug69976.phpt [new file with mode: 0644]
ext/standard/url.c