diff options
-rw-r--r-- | UPGRADING | 5 | ||||
-rw-r--r-- | ext/filter/filter.c | 2 | ||||
-rw-r--r-- | ext/filter/filter_private.h | 2 | ||||
-rw-r--r-- | ext/filter/logical_filters.c | 2 | ||||
-rw-r--r-- | ext/filter/tests/058.phpt | 2 |
5 files changed, 7 insertions, 6 deletions
@@ -146,8 +146,9 @@ PHP 7.1 UPGRADE NOTES - file_get_contents() accepts a negative seek offset if the stream is seekable. - tempnam() throws a notice when failing back to the system temp dir. - getopt() has an extra by-ref parameter : optind -- mb_ereg() and mb_ereg_replace() reject illegal byte sequences -- FILTER_FLAG_EMAIL_RFC6531 can be used with filter_var() for email validation +- mb_ereg() and mb_ereg_replace() reject illegal byte sequences. +- FILTER_FLAG_EMAIL_UNICODE can be used with filter_var() for email validation + according to RFC 6531. ======================================== 6. New Functions diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 3d79a77f8a..5991871c44 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -286,7 +286,7 @@ PHP_MINIT_FUNCTION(filter) REGISTER_LONG_CONSTANT("FILTER_FLAG_HOSTNAME", FILTER_FLAG_HOSTNAME, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FILTER_FLAG_EMAIL_RFC6531", FILTER_FLAG_EMAIL_RFC6531, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("FILTER_FLAG_EMAIL_UNICODE", FILTER_FLAG_EMAIL_UNICODE, CONST_CS | CONST_PERSISTENT); sapi_register_input_filter(php_sapi_filter, php_sapi_filter_init); diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h index ffce723d52..8a44370352 100644 --- a/ext/filter/filter_private.h +++ b/ext/filter/filter_private.h @@ -57,7 +57,7 @@ #define FILTER_FLAG_HOSTNAME 0x100000 -#define FILTER_FLAG_EMAIL_RFC6531 0x100000 +#define FILTER_FLAG_EMAIL_UNICODE 0x100000 #define FILTER_VALIDATE_INT 0x0101 #define FILTER_VALIDATE_BOOLEAN 0x0102 diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 3a4a2946d4..c1a8f541a5 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -609,7 +609,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ const char *regexp; size_t regexp_len; - if (flags & FILTER_FLAG_EMAIL_RFC6531) { + if (flags & FILTER_FLAG_EMAIL_UNICODE) { regexp = regexp0; regexp_len = sizeof(regexp0) - 1; } else { diff --git a/ext/filter/tests/058.phpt b/ext/filter/tests/058.phpt index a10f844b63..f3fa483ed9 100644 --- a/ext/filter/tests/058.phpt +++ b/ext/filter/tests/058.phpt @@ -28,7 +28,7 @@ $values = Array( 'DžǼ੧ఘⅧ⒇৪@example.com', ); foreach ($values as $value) { - var_dump(filter_var($value, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_RFC6531)); + var_dump(filter_var($value, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE)); } echo "Done\n"; ?> |