summaryrefslogtreecommitdiff
path: root/ext/filter
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-01-11 15:43:42 +0100
committerOndřej Surý <ondrej@sury.org>2012-01-11 15:43:42 +0100
commit8f1428d29ef91d74b4d272af171675f2971eb15b (patch)
treea1f4f4d7dc5bfe8096806dd5c5266634e19fa07a /ext/filter
parentc6e4182351e0173fe58de141e143aac2eacf5efe (diff)
downloadphp-8f1428d29ef91d74b4d272af171675f2971eb15b.tar.gz
Imported Upstream version 5.3.9upstream/5.3.9
Diffstat (limited to 'ext/filter')
-rw-r--r--ext/filter/callback_filter.c4
-rw-r--r--ext/filter/filter.c6
-rw-r--r--ext/filter/filter_private.h4
-rw-r--r--ext/filter/logical_filters.c6
-rw-r--r--ext/filter/php_filter.h4
-rw-r--r--ext/filter/sanitizing_filters.c4
-rw-r--r--ext/filter/tests/005.phpt2
-rw-r--r--ext/filter/tests/bug39763.phpt4
-rw-r--r--ext/filter/tests/bug44779.phpt2
-rw-r--r--ext/filter/tests/bug46973.phpt2
-rw-r--r--ext/filter/tests/bug47435.phpt2
-rw-r--r--ext/filter/tests/bug47745.phpt2
-rw-r--r--ext/filter/tests/bug48762.phpt2
-rw-r--r--ext/filter/tests/bug50158.phpt2
-rw-r--r--ext/filter/tests/bug55478.phpt11
15 files changed, 42 insertions, 15 deletions
diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c
index 1a2ec3797..02bc73f52 100644
--- a/ext/filter/callback_filter.c
+++ b/ext/filter/callback_filter.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: callback_filter.c 306939 2011-01-01 02:19:59Z felipe $ */
+/* $Id: callback_filter.c 321634 2012-01-01 13:15:04Z felipe $ */
#include "php_filter.h"
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index 5005c7607..a0e03dbb9 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filter.c 313665 2011-07-25 11:42:53Z felipe $ */
+/* $Id: filter.c 321634 2012-01-01 13:15:04Z felipe $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -318,7 +318,7 @@ PHP_MINFO_FUNCTION(filter)
{
php_info_print_table_start();
php_info_print_table_row( 2, "Input Validation and Filtering", "enabled" );
- php_info_print_table_row( 2, "Revision", "$Revision: 313665 $");
+ php_info_print_table_row( 2, "Revision", "$Revision: 321634 $");
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h
index 5f498273f..ccac304a6 100644
--- a/ext/filter/filter_private.h
+++ b/ext/filter/filter_private.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filter_private.h 307670 2011-01-23 09:46:06Z pajoye $ */
+/* $Id: filter_private.h 321634 2012-01-01 13:15:04Z felipe $ */
#ifndef FILTER_PRIVATE_H
#define FILTER_PRIVATE_H
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 777a2157c..fa86f0f83 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: logical_filters.c 311403 2011-05-24 22:34:07Z felipe $ */
+/* $Id: logical_filters.c 321634 2012-01-01 13:15:04Z felipe $ */
#include "php_filter.h"
#include "filter_private.h"
@@ -522,7 +522,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
* Feel free to use and redistribute this code. But please keep this copyright notice.
*
*/
- const char regexp[] = "/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD";
+ const char regexp[] = "/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-+[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-+[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD";
pcre *re = NULL;
pcre_extra *pcre_extra = NULL;
diff --git a/ext/filter/php_filter.h b/ext/filter/php_filter.h
index 011ff2757..06b00f8c3 100644
--- a/ext/filter/php_filter.h
+++ b/ext/filter/php_filter.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_filter.h 306939 2011-01-01 02:19:59Z felipe $ */
+/* $Id: php_filter.h 321634 2012-01-01 13:15:04Z felipe $ */
#ifndef PHP_FILTER_H
#define PHP_FILTER_H
diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c
index d67920852..3ed3bf176 100644
--- a/ext/filter/sanitizing_filters.c
+++ b/ext/filter/sanitizing_filters.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2011 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sanitizing_filters.c 309920 2011-04-03 16:30:31Z iliaa $ */
+/* $Id: sanitizing_filters.c 321634 2012-01-01 13:15:04Z felipe $ */
#include "php_filter.h"
#include "filter_private.h"
diff --git a/ext/filter/tests/005.phpt b/ext/filter/tests/005.phpt
index f44379153..b3735f562 100644
--- a/ext/filter/tests/005.phpt
+++ b/ext/filter/tests/005.phpt
@@ -1,5 +1,7 @@
--TEST--
GET/REQUEST Test with fifa example data
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
--INI--
filter.default=stripped
--GET--
diff --git a/ext/filter/tests/bug39763.phpt b/ext/filter/tests/bug39763.phpt
index 36ee41561..69d451bbd 100644
--- a/ext/filter/tests/bug39763.phpt
+++ b/ext/filter/tests/bug39763.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #39763 (filter applies magic_quotes twice in parse_str())
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
--INI--
magic_quotes_gpc=1
filter.default=
@@ -14,4 +16,4 @@ echo $val . "\n";
--EXPECT--
Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0
\"probably a bug\"
-\"probably a bug\" \ No newline at end of file
+\"probably a bug\"
diff --git a/ext/filter/tests/bug44779.phpt b/ext/filter/tests/bug44779.phpt
index 33a4fe4ff..65a1e094e 100644
--- a/ext/filter/tests/bug44779.phpt
+++ b/ext/filter/tests/bug44779.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #44779 (filter returns NULL in CLI when it shouldn't)
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
var_dump(filter_input(INPUT_SERVER, "PHP_SELF"));
diff --git a/ext/filter/tests/bug46973.phpt b/ext/filter/tests/bug46973.phpt
index 01a5118cf..eacacf5b3 100644
--- a/ext/filter/tests/bug46973.phpt
+++ b/ext/filter/tests/bug46973.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #46973 (IPv6 address filter rejects valid address)
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
diff --git a/ext/filter/tests/bug47435.phpt b/ext/filter/tests/bug47435.phpt
index 42705fdc6..957a00194 100644
--- a/ext/filter/tests/bug47435.phpt
+++ b/ext/filter/tests/bug47435.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #47435 (FILTER_FLAG_NO_PRIV_RANGE and FILTER_FLAG_NO_RES_RANGE don't work with ipv6)
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
var_dump(filter_var("FC00::1", FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
diff --git a/ext/filter/tests/bug47745.phpt b/ext/filter/tests/bug47745.phpt
index a8656fd93..feb0c2b6d 100644
--- a/ext/filter/tests/bug47745.phpt
+++ b/ext/filter/tests/bug47745.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #47745 (FILTER_VALIDATE_INT doesn't allow minimum integer)
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
$s = (string)(-PHP_INT_MAX-1);
diff --git a/ext/filter/tests/bug48762.phpt b/ext/filter/tests/bug48762.phpt
index 1737f0a75..195a61664 100644
--- a/ext/filter/tests/bug48762.phpt
+++ b/ext/filter/tests/bug48762.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #48762 (IPv6 address filter still rejects valid address)
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
diff --git a/ext/filter/tests/bug50158.phpt b/ext/filter/tests/bug50158.phpt
index fbe2ca3af..72c31a720 100644
--- a/ext/filter/tests/bug50158.phpt
+++ b/ext/filter/tests/bug50158.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #50158 (FILTER_VALIDATE_EMAIL fails with valid addresses containing = or ?)
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
diff --git a/ext/filter/tests/bug55478.phpt b/ext/filter/tests/bug55478.phpt
new file mode 100644
index 000000000..243d7078e
--- /dev/null
+++ b/ext/filter/tests/bug55478.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #55478 (FILTER_VALIDATE_EMAIL fails with internationalized domain name addresses containing >1 -)
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
+--FILE--
+<?php
+$email_address = "test@xn--example--7za.de"; // "example-ä.de"
+var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
+?>
+--EXPECT--
+string(24) "test@xn--example--7za.de"