Skip to content

Commit

Permalink
Fix bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain na…
Browse files Browse the repository at this point in the history
…mes)

(cherry picked from commit c149d4ee4be81ecf005eafd43ede06e70aa4c985)
  • Loading branch information
Syra authored and dsp committed Sep 16, 2013
1 parent 8a936e8 commit 18b54a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 0 additions & 4 deletions ext/filter/logical_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,6 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
}
s++;
}

if (*(e - 1) == '.') {
goto bad_url;
}
}

if (
Expand Down
11 changes: 11 additions & 0 deletions ext/filter/tests/bug64441.phpt
Original file line number Diff line number Diff line change
@@ -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/"

0 comments on commit 18b54a2

Please sign in to comment.