summaryrefslogtreecommitdiff
path: root/ext/filter
diff options
context:
space:
mode:
authorDavid Soria Parra <dsp@php.net>2013-09-16 23:36:37 +0200
committerDavid Soria Parra <dsp@php.net>2013-09-16 23:36:37 +0200
commit3d6ac70e6652c2c15b180e3f34fdc061e47f68a4 (patch)
treebf96f616861f6f5b73dccf4d7058fd50ee299ad6 /ext/filter
parentb5283b9b7abecde841eb268c4b158cd76630d53b (diff)
parent6a0b90da84433ab1b0844a96036f3185d8a29cef (diff)
downloadphp-git-3d6ac70e6652c2c15b180e3f34fdc061e47f68a4.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: NEWS for #60577 NEWS for bug #64441 Fix bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names) EmptyIterator now implements Countable; fixes bug 60577 News for bugfix #64157 Bug 64157 Changed error message to make sense
Diffstat (limited to 'ext/filter')
-rw-r--r--ext/filter/logical_filters.c4
-rw-r--r--ext/filter/tests/bug64441.phpt11
2 files changed, 11 insertions, 4 deletions
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index b8df2183b9..9a26cc65d9 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -484,10 +484,6 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
}
s++;
}
-
- if (*(e - 1) == '.') {
- goto bad_url;
- }
}
if (
diff --git a/ext/filter/tests/bug64441.phpt b/ext/filter/tests/bug64441.phpt
new file mode 100644
index 0000000000..149079ec05
--- /dev/null
+++ b/ext/filter/tests/bug64441.phpt
@@ -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/"