Bug #68049 [Com]: filter_var echo wrong result for a url

From: Date: Sun, 21 Sep 2014 08:34:57 +0000
Subject: Bug #68049 [Com]: filter_var echo wrong result for a url
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187635@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 Comment by: florian at margaine dot com Reported by: luerfeng2012 at gmail dot com Summary: filter_var echo wrong result for a url Status: Open Type: Bug Package: Strings related Operating System: Windows 7 PHP Version: 5.4Git-2014-09-19 (Git) Block user comment: N Private report: N New Comment: Hi, This seems to be wanted behavior, see https://bugs.php.net/bug.php?id=51192 However, browsers *do* accepts underscores in the host. Previous Comments: ------------------------------------------------------------------------ [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 (#187635) next »