Skip to content

Commit 0f96e6a

Browse files
committed
Change "null character" to "NUL"
Avoid extra warning
1 parent 98ae12e commit 0f96e6a

10 files changed

+18
-20
lines changed

ext/pcre/php_pcre.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
666666
if (key != regex) {
667667
zend_string_release_ex(key, 0);
668668
}
669-
php_error_docref(NULL, E_WARNING, delimiter == '\0' ?
670-
"Delimiter must not be a null character" :
671-
"Delimiter must not be alphanumeric or backslash");
669+
php_error_docref(NULL, E_WARNING, "Delimiter must not be alphanumeric, backslash, or NUL");
672670
pcre_handle_exec_error(PCRE2_ERROR_INTERNAL);
673671
return NULL;
674672
}
@@ -766,7 +764,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
766764
if (pp[-1]) {
767765
php_error_docref(NULL, E_WARNING, "Unknown modifier '%c'", pp[-1]);
768766
} else {
769-
php_error_docref(NULL, E_WARNING, "Null character is not a valid modifier");
767+
php_error_docref(NULL, E_WARNING, "NUL is not a valid modifier");
770768
}
771769
pcre_handle_exec_error(PCRE2_ERROR_INTERNAL);
772770
efree(pattern);

ext/pcre/tests/bug73392.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ var_dump(preg_replace_callback_array(
2121
), 'a'));
2222
?>
2323
--EXPECTF--
24-
Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric or backslash in %sbug73392.php on line %d
24+
Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric, backslash, or NUL in %sbug73392.php on line %d
2525
NULL

ext/pcre/tests/delimiters.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Warning: preg_match(): Empty regular expression in %sdelimiters.php on line 4
2323
bool(false)
2424
int(1)
2525

26-
Warning: preg_match(): Delimiter must not be alphanumeric or backslash in %sdelimiters.php on line 6
26+
Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in %sdelimiters.php on line 6
2727
bool(false)
2828
int(1)
2929

@@ -37,5 +37,5 @@ bool(false)
3737
Warning: preg_match(): No ending matching delimiter '}' found in %sdelimiters.php on line 11
3838
bool(false)
3939

40-
Warning: preg_match(): Delimiter must not be a null character in %sdelimiters.php on line 12
40+
Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in %sdelimiters.php on line 12
4141
bool(false)

ext/pcre/tests/null_bytes.phpt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,28 @@ preg_replace("/foo/e\0/i", "echo('Eek');", "");
3131

3232
?>
3333
--EXPECTF--
34-
Warning: preg_match(): Delimiter must not be a null character in %snull_bytes.php on line 3
34+
Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in %snull_bytes.php on line 3
3535
bool(false)
3636
int(0)
3737
int(1)
3838

39-
Warning: preg_match(): Null character is not a valid modifier in %snull_bytes.php on line 6
39+
Warning: preg_match(): NUL is not a valid modifier in %snull_bytes.php on line 6
4040
bool(false)
4141

42-
Warning: preg_match(): Null character is not a valid modifier in %snull_bytes.php on line 7
42+
Warning: preg_match(): NUL is not a valid modifier in %snull_bytes.php on line 7
4343
bool(false)
4444
int(0)
4545
int(1)
4646

47-
Warning: preg_match(): Delimiter must not be a null character in %snull_bytes.php on line 11
47+
Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in %snull_bytes.php on line 11
4848
bool(false)
4949
int(0)
5050
int(1)
5151

52-
Warning: preg_match(): Null character is not a valid modifier in %snull_bytes.php on line 14
52+
Warning: preg_match(): NUL is not a valid modifier in %snull_bytes.php on line 14
5353
bool(false)
5454

55-
Warning: preg_match(): Null character is not a valid modifier in %snull_bytes.php on line 15
55+
Warning: preg_match(): NUL is not a valid modifier in %snull_bytes.php on line 15
5656
bool(false)
5757
int(0)
5858
int(1)
@@ -63,4 +63,4 @@ int(0)
6363
int(1)
6464
int(0)
6565

66-
Warning: preg_replace(): Null character is not a valid modifier in %snull_bytes.php on line 27
66+
Warning: preg_replace(): NUL is not a valid modifier in %snull_bytes.php on line 27

ext/pcre/tests/preg_grep_error1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ echo "Done"
3737

3838
Arg value is abcdef
3939

40-
Warning: preg_grep(): Delimiter must not be alphanumeric or backslash in %spreg_grep_error1.php on line %d
40+
Warning: preg_grep(): Delimiter must not be alphanumeric, backslash, or NUL in %spreg_grep_error1.php on line %d
4141
bool(false)
4242

4343
Arg value is /[a-zA-Z]

ext/pcre/tests/preg_match_all_error1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var_dump($matches);
3838

3939
Arg value is abcdef
4040

41-
Warning: preg_match_all(): Delimiter must not be alphanumeric or backslash in %spreg_match_all_error1.php on line %d
41+
Warning: preg_match_all(): Delimiter must not be alphanumeric, backslash, or NUL in %spreg_match_all_error1.php on line %d
4242
bool(false)
4343
NULL
4444

ext/pcre/tests/preg_match_error1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ try {
3434

3535
Arg value is abcdef
3636

37-
Warning: preg_match(): Delimiter must not be alphanumeric or backslash in %spreg_match_error1.php on line %d
37+
Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in %spreg_match_error1.php on line %d
3838
bool(false)
3939

4040
Arg value is /[a-zA-Z]

ext/pcre/tests/preg_replace_callback_error1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ foreach($regex_array as $regex_value) {
3030

3131
Arg value is abcdef
3232

33-
Warning: preg_replace_callback(): Delimiter must not be alphanumeric or backslash in %s on line %d
33+
Warning: preg_replace_callback(): Delimiter must not be alphanumeric, backslash, or NUL in %s on line %d
3434
NULL
3535

3636
Arg value is /[a-zA-Z]

ext/pcre/tests/preg_replace_error1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ try {
3333

3434
Arg value is abcdef
3535

36-
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash in %spreg_replace_error1.php on line %d
36+
Warning: preg_replace(): Delimiter must not be alphanumeric, backslash, or NUL in %spreg_replace_error1.php on line %d
3737
NULL
3838

3939
Arg value is /[a-zA-Z]

ext/pcre/tests/preg_split_error1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ try {
3636

3737
Arg value is abcdef
3838

39-
Warning: preg_split(): Delimiter must not be alphanumeric or backslash in %spreg_split_error1.php on line %d
39+
Warning: preg_split(): Delimiter must not be alphanumeric, backslash, or NUL in %spreg_split_error1.php on line %d
4040
bool(false)
4141

4242
Arg value is /[a-zA-Z]

0 commit comments

Comments
 (0)