summaryrefslogtreecommitdiff
path: root/ext/filter
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:48 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:48 -0400
commiteddbbea4325e602ddc87c545531609132d4f0e3b (patch)
treef0994206a7e0a6251be7cc6729ba480f0c8729c2 /ext/filter
parent2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b (diff)
downloadphp-eddbbea4325e602ddc87c545531609132d4f0e3b.tar.gz
Imported Upstream version 5.2.3upstream/5.2.3
Diffstat (limited to 'ext/filter')
-rw-r--r--ext/filter/logical_filters.c4
-rw-r--r--ext/filter/tests/031.phpt2
-rw-r--r--ext/filter/tests/033.phpt2
-rw-r--r--ext/filter/tests/044.phpt2
-rw-r--r--ext/filter/tests/PMOPB45.phpt11
-rw-r--r--ext/filter/tests/bug39763.phpt2
-rw-r--r--ext/filter/tests/filter_data.phpt2
7 files changed, 22 insertions, 3 deletions
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 73220bc5d..4463f4e0d 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: logical_filters.c,v 1.1.2.21 2007/01/01 09:36:00 sebastian Exp $ */
+/* $Id: logical_filters.c,v 1.1.2.22 2007/05/03 23:38:27 iliaa Exp $ */
#include "php_filter.h"
#include "filter_private.h"
@@ -469,7 +469,7 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
{
/* From http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4 */
- const char regexp[] = "/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\\-])+\\.)+[A-Za-z\\-]+))$/";
+ const char regexp[] = "/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\\-])+\\.)+[A-Za-z\\-]+))$/D";
pcre *re = NULL;
pcre_extra *pcre_extra = NULL;
diff --git a/ext/filter/tests/031.phpt b/ext/filter/tests/031.phpt
index 02ef90a34..23691fbbb 100644
--- a/ext/filter/tests/031.phpt
+++ b/ext/filter/tests/031.phpt
@@ -2,6 +2,8 @@
filter_var() and FLOAT
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
+--INI--
+precision=14
--FILE--
<?php
diff --git a/ext/filter/tests/033.phpt b/ext/filter/tests/033.phpt
index 18a361690..f965e35c1 100644
--- a/ext/filter/tests/033.phpt
+++ b/ext/filter/tests/033.phpt
@@ -2,6 +2,8 @@
Test all filters returned by filter_list()
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
+--INI--
+precision=14
--FILE--
<?php
include dirname(__FILE__) . '/033_run.inc';
diff --git a/ext/filter/tests/044.phpt b/ext/filter/tests/044.phpt
index 6fa6c2e30..ff4689381 100644
--- a/ext/filter/tests/044.phpt
+++ b/ext/filter/tests/044.phpt
@@ -2,6 +2,8 @@
Integer validation with spaces
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
+--INI--
+precision=14
--FILE--
<?php
$vals = array(
diff --git a/ext/filter/tests/PMOPB45.phpt b/ext/filter/tests/PMOPB45.phpt
new file mode 100644
index 000000000..532eb219d
--- /dev/null
+++ b/ext/filter/tests/PMOPB45.phpt
@@ -0,0 +1,11 @@
+--TEST--
+PMOPB-45-2007:PHP ext/filter Email Validation Vulnerability
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
+--FILE--
+<?php
+ $var = "test@example.com\n";
+ var_dump(filter_var($var, FILTER_VALIDATE_EMAIL));
+?>
+--EXPECT--
+bool(false)
diff --git a/ext/filter/tests/bug39763.phpt b/ext/filter/tests/bug39763.phpt
index cc8d9ccee..b0eaaadf0 100644
--- a/ext/filter/tests/bug39763.phpt
+++ b/ext/filter/tests/bug39763.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #39763 filter applies magic_quotes twice in parse_str()
+Bug #39763 (filter applies magic_quotes twice in parse_str())
--INI--
magic_quotes_gpc=1
filter.default=
diff --git a/ext/filter/tests/filter_data.phpt b/ext/filter/tests/filter_data.phpt
index 6926a8851..1071b3efa 100644
--- a/ext/filter/tests/filter_data.phpt
+++ b/ext/filter/tests/filter_data.phpt
@@ -2,6 +2,8 @@
Simple filter_var() tests
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
+--INI--
+precision=14
--FILE--
<?php