Bug #77804 [Opn->Nab]: parse_url illegal host
Edit report at https://bugs.php.net/bug.php?id=77804&edit=1
ID: 77804
Updated by: sjon@php.net
Reported by: 1085242202 at qq dot com
Summary: parse_url illegal host
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Red Hat Enterprise Linux Server
PHP Version: master-Git-2019-03-27 (Git)
Block user comment: N
Private report: N
New Comment:
I'm pretty sure the given domain-name is simply incorrect, as \ is not an allowed character
according to https://tools.ietf.org/html/rfc1034
Additionally, the documentation of parse_url says:
> This function is not meant to validate the given URL, it only breaks it up into the above
> listed parts.
so this is al pretty much expected behaviour
Previous Comments:
------------------------------------------------------------------------
[2019-03-27 08:13:51] 1085242202 at qq dot com
Description:
------------
"var_dump(parse_url('http://baidu.com\pinyin.sogou.com'));"
array(2) {
["scheme"]=>
string(4) "http"
["host"]=>
string(26) "baidu.com\pinyin.sogou.com"
}
"baidu.com\pinyin.sogou.com" maybe is an illegal host
ps:ç©ºæ ¼å符å·å¦âï¼/\ï¼ï¼@#$%^~_=+ï¼8ï¼
ã<>âçé½ä¸è½ç¨å¨ååå½å https://zhidao.baidu.com/question/337004301.html
Test script:
---------------
var_dump(parse_url('http://baidu.com\pinyin.sogou.com'));
array(2) {
["scheme"]=>
string(4) "http"
["host"]=>
string(26) "baidu.com\pinyin.sogou.com"
}
Expected result:
----------------
array(2) {
["scheme"]=>
string(4) "http"
["host"]=>
string(26) "baidu.com"
}
Actual result:
--------------
array(2) {
["scheme"]=>
string(4) "http"
["host"]=>
string(26) "baidu.com\pinyin.sogou.com"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77804&edit=1
Thread (2 messages)