Skip to content

Commit 7ae7b4e

Browse files
authored
Correctly specify secret instead of seed in ext/hash deprecation message (#15557)
Reference: 74eff98#r145528001
1 parent f9c69bc commit 7ae7b4e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ext/hash/hash_xxhash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ zend_always_inline static void _PHP_XXH3_Init(PHP_XXH3_64_CTX *ctx, HashTable *a
183183
return;
184184
} else if (_secret) {
185185
if (IS_STRING != Z_TYPE_P(_secret)) {
186-
php_error_docref(NULL, E_DEPRECATED, "Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs");
186+
php_error_docref(NULL, E_DEPRECATED, "Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs");
187187
}
188188
zend_string *secret_string = zval_try_get_string(_secret);
189189
if (UNEXPECTED(!secret_string)) {

ext/hash/tests/xxh3_convert_secret_to_string.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ try {
88
var_dump($x);
99
?>
1010
--EXPECTF--
11-
Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
11+
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
1212
array(1) {
1313
["secret"]=>
1414
int(4)

ext/hash/tests/xxhash_secret.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ foreach (["xxh3", "xxh128"] as $a) {
4949
--EXPECTF--
5050
string(67) "xxh3: Only one of seed or secret is to be passed for initialization"
5151

52-
Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
52+
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
5353
string(23) "exception in __toString"
5454
string(57) "xxh3: Secret length must be >= 136 bytes, 17 bytes passed"
5555
8028aa834c03557a == 8028aa834c03557a == true
5656
string(69) "xxh128: Only one of seed or secret is to be passed for initialization"
5757

58-
Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
58+
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
5959
string(23) "exception in __toString"
6060
string(59) "xxh128: Secret length must be >= 136 bytes, 17 bytes passed"
6161
54279097795e7218093a05d4d781cbb9 == 54279097795e7218093a05d4d781cbb9 == true

ext/hash/tests/xxhash_seed_deprecation.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ Deprecated: hash_init(): Passing a seed of a type other than int is deprecated b
2323

2424
Deprecated: hash_init(): Passing a seed of a type other than int is deprecated because it is ignored in %s on line %d
2525

26-
Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
26+
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
2727

28-
Deprecated: hash_init(): Passing a seed of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d
28+
Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d

0 commit comments

Comments
 (0)