Bug #76212 [Opn->Nab]: Filter var URL with underscore in hostname
| From: | requinix@php.net | Date: | Thu, 12 Apr 2018 09:15:59 +0000 |
| Subject: | Bug #76212 [Opn->Nab]: Filter var URL with underscore in hostname | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214711@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76212&edit=1
ID: 76212
Updated by: requinix@php.net
Reported by: dimitri at sponsorboost dot com
Summary: Filter var URL with underscore in hostname
-Status: Open
+Status: Not a bug
Type: Bug
Package: Filter related
Operating System: Windows (XAMPP)
PHP Version: 7.0.29
Block user comment: N
Private report: N
New Comment:
As commented.
Previous Comments:
------------------------------------------------------------------------
[2018-04-12 08:48:45] spam2 at rhsoft dot net
just don't do that - countless developer hours are wasted in the past years because of such
hostnames and then finally test in different browsers and find out after hhours that MSIE don't
like cookies for hostnames which must not exist
------------------------------------------------------------------------
[2018-04-12 08:44:52] sjon at hortensius dot net
I think this explains it pretty good: https://stackoverflow.com/a/2183140/3749523
> for host names (or for URLs, which include a host name), [..] this is different, the relevant
> standard is RFC 1123, section 2.1 "Host Names and Numbers" which limits host names to
> letters-digits-hyphen.
------------------------------------------------------------------------
[2018-04-12 08:29:11] dimitri at sponsorboost dot com
Description:
------------
Hostname can't contain underscore '_'.
I find RFC norme : this https://tools.ietf.org/html/rfc3986#section-2.3
Test script:
---------------
var_dump(filter_var('http://testscript.com',FILTER_VALIDATE_URL));
var_dump(filter_var('http://test_script.com',FILTER_VALIDATE_URL));
Expected result:
----------------
string 'http://testscript.com'
string 'http://test_script.com'
Actual result:
--------------
string 'http://testscript.com'
boolean false
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76212&edit=1