Fix bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names)

(cherry picked from commit c149d4ee4be81ecf005eafd43ede06e70aa4c985)
This commit is contained in:
Alex Bobrov 2013-04-21 14:32:02 +07:00 committed by David Soria Parra
parent 8a936e8eb9
commit 18b54a2366
2 changed files with 11 additions and 4 deletions

View File

@ -484,10 +484,6 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
}
s++;
}
if (*(e - 1) == '.') {
goto bad_url;
}
}
if (

View File

@ -0,0 +1,11 @@
--TEST--
bug 64441, FILTER_VALIDATE_URL will invalidate a hostname that ended by dot
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
var_dump(filter_var('http://example.com./', FILTER_VALIDATE_URL));
var_dump(filter_var('http://example.com/', FILTER_VALIDATE_URL));
--EXPECT--
string(20) "http://example.com./"
string(19) "http://example.com/"