Skip to content

Conversation

IanDelMar
Copy link
Contributor

Narrows $hex_encoding from int to 0|1 for antispambot().

While passing integers other than 0 (default) or 1 does not trigger PHP or WordPress errors, it expands the random range rand(0, 1 + $hex_encoding), allowing values (e.g. 3) that hit no branch and therefore omit characters. -1 would preserve correct email addresses, but since the parameter description says:

Set to 1 to enable hex encoding.

it has been narrowed to 0|1.

@IanDelMar IanDelMar changed the title Narrow the parameter type for antispambot() Narrow parameter type for antispambot() Sep 9, 2025
@szepeviktor szepeviktor merged commit 945a6da into php-stubs:master Sep 9, 2025
7 checks passed
@IanDelMar IanDelMar deleted the antispambot branch September 9, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants