Bug #51192 [Opn]: FILTER_VALIDATE_URL will invalidate an url with a hostname that includes

From: Date: Wed, 03 Mar 2010 07:56:19 +0000
Subject: Bug #51192 [Opn]: FILTER_VALIDATE_URL will invalidate an url with a hostname that includes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148202@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51192&edit=1

 ID:               51192
 User updated by:  solar at azrael dot ws
 Reported by:      solar at azrael dot ws
 Summary:          FILTER_VALIDATE_URL will invalidate an url with a
                   hostname that includes
 Status:           Open
 Type:             Bug
 Package:          Filter related
 Operating System: linux
 PHP Version:      5.2.13

 New Comment:

Oops.

Test script:

var_dump(filter_var('http://example.com',
FILTER_VALIDATE_URL));
var_dump(filter_var('http://exa-mple.com',
FILTER_VALIDATE_URL));
var_dump(filter_var('http://exa_mple.com',
FILTER_VALIDATE_URL));


Previous Comments:
------------------------------------------------------------------------
[2010-03-03 08:49:39] solar at azrael dot ws

Description:
------------
Hostname must contain only alpha-numeric letters and the hyphen(-).

Test script:
---------------
var_dump(filter_var(

Expected result:
----------------
string(18) "http://example.com"
string(19) "http://exa-mple.com"
bool(false)

Actual result:
--------------
string(18) "http://example.com"
bool(false)
string(19) "http://exa_mple.com"


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51192&edit=1


Thread (13 messages)

« previous php.bugs (#148202) next »