Bug #77804 [NEW]: parse_url illegal host

From: Date: Wed, 27 Mar 2019 08:13:51 +0000
Subject: Bug #77804 [NEW]: parse_url illegal host
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220221@lists.php.net to get a copy of this message
From: 1085242202 at qq dot com Operating system: Red Hat Enterprise Linux Server PHP version: master-Git-2019-03-27 (Git) Package: *General Issues Bug Type: Bug Bug description:parse_url illegal host 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 bug report at https://bugs.php.net/bug.php?id=77804&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77804&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77804&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77804&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77804&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77804&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77804&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77804&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77804&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77804&r=support Expected behavior: https://bugs.php.net/fix.php?id=77804&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77804&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77804&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77804&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77804&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77804&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77804&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77804&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77804&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77804&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77804&r=mysqlcfg

« previous php.bugs (#220221) next »