Bug #64948 [Com]: FILTER_VALIDATE_URL does not see urls with underscores as valid URLs.

From: Date: Wed, 17 Oct 2018 14:33:51 +0000
Subject: Bug #64948 [Com]: FILTER_VALIDATE_URL does not see urls with underscores as valid URLs.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217613@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64948&edit=1 ID: 64948 Comment by: rh at tfli dot co dot uk Reported by: neclimdul at gmail dot com Summary: FILTER_VALIDATE_URL does not see urls with underscores as valid URLs. Status: Open Type: Bug Package: Filter related Operating System: Ubuntu PHP Version: 7.2 Block user comment: N Private report: N New Comment: FWIW, the URL https://electrictobacconist_co_uk.secure-cdn.visualsoft.co.uk/images/gamucci-refills-p86-15678_image.jpg loads on both MSIE 11 and MS Edge (both on Win10). I haven't gone as far to check how far it works (e.g. cookies, etc), but it does load the resource - so I would be inclined to agree with requinix. Previous Comments: ------------------------------------------------------------------------ [2018-10-17 03:17:54] yohgaki@php.net Hostname shouldn't have "_". However, NETBIOS allows "_" in hostname. DomainKeys/etc use "_" to distinguish service name and hostname. This isn't a bug, but feature request for additional option like FILTER_VALIDATE_URL_WITH_UNDERSCORE or FILTER_VALIDATE_SERVICE_URL. ------------------------------------------------------------------------ [2018-10-16 16:05:20] spam2 at rhsoft dot net yeah they are somehow supported then get MSIE and try to verify a web-app working on it too you developed with chrome/firefox and wonder about all sorts of randomly lost cookies and session errors my co-worker repeatly wasted hours by add a hostname with underscore to /etc/hosts on his development machine and then searching issues which would not have happened by follow RFC's just becaus some fools ignore RFCs makes it not a good idea to follow ------------------------------------------------------------------------ [2018-10-16 16:02:42] requinix@php.net That URL clearly shows that underscores are supported. At least in my browser. Whether RFCs technically allow for it or not is besides the point now. I think FILTER_VALIDATE_URL should allow underscores. ------------------------------------------------------------------------ [2018-10-16 09:34:20] spam2 at rhsoft dot net so blame that fool, even wikipedia knows https://en.wikipedia.org/wiki/Hostname The Internet standards (Requests for Comments) for protocols mandate that component hostname labels may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits '0' through '9', and the minus sign ('-'). The original specification of hostnames in RFC 952, mandated that labels could not start with a digit or with a minus sign, and must not end with a minus sign. However, a subsequent specification (RFC 1123) permitted hostname labels to start with digits. No other symbols, punctuation characters, or white space are permitted. While a hostname may not contain other characters, such as the underscore character (_), other DNS names may contain the underscore.[4][5] Systems such as DomainKeys and service records use the underscore as a means to assure that their special character is not confused with hostnames ------------------------------------------------------------------------ [2018-10-16 09:29:34] luke at reviews dot co dot uk As requested, the below URL is what caused me to stumble across this "bug" https://electrictobacconist_co_uk.secure-cdn.visualsoft.co.uk/images/gamucci-refills-p86-15678_image.jpg ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=64948 -- Edit this bug report at https://bugs.php.net/bug.php?id=64948&edit=1

« previous php.bugs (#217613) next »