mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
Fix bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names)
(cherry picked from commit c149d4ee4be81ecf005eafd43ede06e70aa4c985)
This commit is contained in:
parent
8a936e8eb9
commit
18b54a2366
@ -484,10 +484,6 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
||||
if (*(e - 1) == '.') {
|
||||
goto bad_url;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
|
11
ext/filter/tests/bug64441.phpt
Normal file
11
ext/filter/tests/bug64441.phpt
Normal 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/"
|
Loading…
Reference in New Issue
Block a user