Bug #68049 [Opn->Dup]: filter_var echo wrong result for a url

From: Date: Tue, 07 Apr 2020 14:26:17 +0000
Subject: Bug #68049 [Opn->Dup]: filter_var echo wrong result for a url
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226465@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68049&edit=1 ID: 68049 Updated by: cmb@php.net Reported by: luerfeng2012 at gmail dot com Summary: filter_var echo wrong result for a url -Status: Open +Status: Duplicate Type: Bug Package: Strings related Operating System: Windows 7 PHP Version: 5.4Git-2014-09-19 (Git) -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Duplicate of bug #64948. Previous Comments: ------------------------------------------------------------------------ [2014-09-21 08:58:54] florian at margaine dot com Also related: https://bugs.php.net/bug.php?id=68039 ------------------------------------------------------------------------ [2014-09-21 08:42:41] florian at margaine dot com Another note: according to the rfc 3986, this is not a valid URL. See: http://tools.ietf.org/html/rfc3986#section-3.2.2 ------------------------------------------------------------------------ [2014-09-21 08:34:56] florian at margaine dot com Hi, This seems to be wanted behavior, see https://bugs.php.net/bug.php?id=51192 However, browsers *do* accepts underscores in the host. ------------------------------------------------------------------------ [2014-09-19 04:50:15] luerfeng2012 at gmail dot com Description: ------------ 5.4.28 Test script: --------------- $url='http://dl_dir.qq.com/minigamefile/QQGameWorld.EXE'; if(filter_var($url,FILTER_VALIDATE_URL)) { echo 'valid url'; }else{ echo 'invalid url'; } Expected result: ---------------- valid url Actual result: -------------- invalid url ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68049&edit=1

« previous php.bugs (#226465) next »