php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77804 parse_url illegal host
Submitted: 2019-03-27 08:13 UTC Modified: -
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: 1085242202 at qq dot com Assigned:
Status: Open Package: *General Issues
PHP Version: master-Git-2019-03-27 (Git) OS: Red Hat Enterprise Linux Server
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-03-27 08:13 UTC] 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"
}

Patches

patch.txt (last revision 2019-03-27 08:32 UTC by 1085242202 at qq dot com)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 03:01:25 2019 UTC