mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fixed bug #68917 (parse_url fails on some partial urls)
This commit is contained in:
commit
469b5a9584
4
NEWS
4
NEWS
@ -6,6 +6,10 @@
|
||||
. Fixed bugs #68853, #65137 (Buffered crypto stream data breaks IO polling
|
||||
in stream_select() contexts) (Chris Wright)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #68917 (parse_url fails on some partial urls). (Wei Dai)
|
||||
|
||||
|
||||
19 Mar 2015, PHP 5.6.7
|
||||
|
||||
- Core:
|
||||
|
23
ext/standard/tests/url/bug68917.phpt
Normal file
23
ext/standard/tests/url/bug68917.phpt
Normal file
@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #68917 (parse_url fails on some partial urls)
|
||||
--FILE--
|
||||
<?php
|
||||
print_r(parse_url('//example.org:81/hi?a=b#c=d'));
|
||||
print_r(parse_url('//example.org/hi?a=b#c=d'));
|
||||
?>
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[host] => example.org
|
||||
[port] => 81
|
||||
[path] => /hi
|
||||
[query] => a=b
|
||||
[fragment] => c=d
|
||||
)
|
||||
Array
|
||||
(
|
||||
[host] => example.org
|
||||
[path] => /hi
|
||||
[query] => a=b
|
||||
[fragment] => c=d
|
||||
)
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user