Bug #51258 [Opn->Bgs]: FILTER_VALIDATE_URL thinks dashes/hyphens in host name are invalid

From: Date: Wed, 10 Mar 2010 12:30:00 +0000
Subject: Bug #51258 [Opn->Bgs]: FILTER_VALIDATE_URL thinks dashes/hyphens in host name are invalid
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148469@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51258&edit=1 ID: 51258 Updated by: felipe@php.net Reported by: bugs dot php dot net at moesen dot nu Summary: FILTER_VALIDATE_URL thinks dashes/hyphens in host name are invalid -Status: Open +Status: Bogus Type: Bug Package: Filter related Operating System: Debian Lenny using Dotdeb PHP Version: 5.3.2 New Comment: Hello, this bug already was fixed days ago. See bug #51192 Anyway, thanks for reporting. :) Previous Comments: ------------------------------------------------------------------------ [2010-03-10 12:48:46] bugs dot php dot net at moesen dot nu Description: ------------ FILTER_VALIDATE_URL does not allow dashes/hyphens in the host name. That's just silly. Test script: --------------- $ php -r 'var_dump(filter_var("http://www.something.com/", FILTER_VALIDATE_URL));' $ php -r 'var_dump(filter_var("http://www.some-thing.com/", FILTER_VALIDATE_URL));' Expected result: ---------------- $ php -r 'var_dump(filter_var("http://www.something.com/", FILTER_VALIDATE_URL));' string(25) "http://www.something.com/" $ php -r 'var_dump(filter_var("http://www.some-thing.com/", FILTER_VALIDATE_URL));' string(26) "http://www.some-thing.com/" Actual result: -------------- $ php -r 'var_dump(filter_var("http://www.something.com/", FILTER_VALIDATE_URL));' string(25) "http://www.something.com/" $ php -r 'var_dump(filter_var("http://www.some-thing.com/", FILTER_VALIDATE_URL));' bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51258&edit=1

« previous php.bugs (#148469) next »