Skip to content

Commit 7f3375d

Browse files
committed
make constant name more descriptive
1 parent f5452b2 commit 7f3375d

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

UPGRADING

+3-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ PHP 7.1 UPGRADE NOTES
146146
- file_get_contents() accepts a negative seek offset if the stream is seekable.
147147
- tempnam() throws a notice when failing back to the system temp dir.
148148
- getopt() has an extra by-ref parameter : optind
149-
- mb_ereg() and mb_ereg_replace() reject illegal byte sequences
150-
- FILTER_FLAG_EMAIL_RFC6531 can be used with filter_var() for email validation
149+
- mb_ereg() and mb_ereg_replace() reject illegal byte sequences.
150+
- FILTER_FLAG_EMAIL_UNICODE can be used with filter_var() for email validation
151+
according to RFC 6531.
151152

152153
========================================
153154
6. New Functions

ext/filter/filter.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ PHP_MINIT_FUNCTION(filter)
286286

287287
REGISTER_LONG_CONSTANT("FILTER_FLAG_HOSTNAME", FILTER_FLAG_HOSTNAME, CONST_CS | CONST_PERSISTENT);
288288

289-
REGISTER_LONG_CONSTANT("FILTER_FLAG_EMAIL_RFC6531", FILTER_FLAG_EMAIL_RFC6531, CONST_CS | CONST_PERSISTENT);
289+
REGISTER_LONG_CONSTANT("FILTER_FLAG_EMAIL_UNICODE", FILTER_FLAG_EMAIL_UNICODE, CONST_CS | CONST_PERSISTENT);
290290

291291
sapi_register_input_filter(php_sapi_filter, php_sapi_filter_init);
292292

ext/filter/filter_private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
#define FILTER_FLAG_HOSTNAME 0x100000
5959

60-
#define FILTER_FLAG_EMAIL_RFC6531 0x100000
60+
#define FILTER_FLAG_EMAIL_UNICODE 0x100000
6161

6262
#define FILTER_VALIDATE_INT 0x0101
6363
#define FILTER_VALIDATE_BOOLEAN 0x0102

ext/filter/logical_filters.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
609609
const char *regexp;
610610
size_t regexp_len;
611611

612-
if (flags & FILTER_FLAG_EMAIL_RFC6531) {
612+
if (flags & FILTER_FLAG_EMAIL_UNICODE) {
613613
regexp = regexp0;
614614
regexp_len = sizeof(regexp0) - 1;
615615
} else {

ext/filter/tests/058.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $values = Array(
2828
'DžǼ੧ఘⅧ⒇৪@example.com',
2929
);
3030
foreach ($values as $value) {
31-
var_dump(filter_var($value, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_RFC6531));
31+
var_dump(filter_var($value, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE));
3232
}
3333
echo "Done\n";
3434
?>

0 commit comments

Comments
 (0)