xref: /PHP-7.2/ext/standard/tests/url/bug77423.phpt (revision 2d3d7241)
1--TEST--
2Bug #77423 (parse_url() will deliver a wrong host to user)
3--FILE--
4<?php
5$urls = array(
6    "http://php.net\@aliyun.com/aaa.do",
7    "https://example.com\uFF03@bing.com",
8);
9foreach ($urls as $url) {
10    var_dump(filter_var($url, FILTER_VALIDATE_URL));
11    var_dump(parse_url($url));
12}
13?>
14--EXPECT--
15bool(false)
16array(3) {
17  ["scheme"]=>
18  string(4) "http"
19  ["host"]=>
20  string(19) "php.net\@aliyun.com"
21  ["path"]=>
22  string(7) "/aaa.do"
23}
24bool(false)
25array(2) {
26  ["scheme"]=>
27  string(5) "https"
28  ["host"]=>
29  string(26) "example.com\uFF03@bing.com"
30}
31