Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 26, 2022

Apparently, hexadecimal numeric strings are still supported in a limited number of PHP functions. While if they are passed in as a variable, we're out of luck, if the text string is hard-coded in the function call, we can prevent a false positive.

This commit adds the logic necessary to prevent these false positives for a limited set of functions currently known to still support hexadecimal numeric strings.

Note: The logic takes function calls using PHP 8.0 named parameters into account.

Includes unit tests.

Fixes #1345

@jrfnl jrfnl added Type: bug PR: quick merge PR only contains relatively simple changes PR: ready for review labels Oct 26, 2022
@jrfnl jrfnl added this to the 10.0.0 milestone Oct 26, 2022
@jrfnl jrfnl requested a review from wimg October 26, 2022 09:38
Copy link

@MPParsley MPParsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Apparently, hexadecimal numeric strings are still supported in a limited number of PHP functions.
While if they are passed in as a variable, we're out of luck, if the text string is hard-coded in the function call, we can prevent a false positive.

This commit adds the logic necessary to prevent these false positives for a limited set of functions currently known to still support hexadecimal numeric strings.

Note: The logic takes function calls using PHP 8.0 named parameters into account.

Includes unit tests.

Fixes 1345
@jrfnl jrfnl force-pushed the feature/1345-validintegers-prevent-false-positive branch from a049ab0 to 8dff65c Compare October 28, 2022 05:30
@jrfnl
Copy link
Member Author

jrfnl commented Oct 28, 2022

Rebased without changes to get it passed the merged conflicts. Will merge once the build passes.

@jrfnl jrfnl enabled auto-merge October 28, 2022 05:30
@jrfnl jrfnl merged commit 5c6bf16 into develop Oct 28, 2022
@jrfnl jrfnl deleted the feature/1345-validintegers-prevent-false-positive branch October 28, 2022 05:52
@jrfnl jrfnl removed PR: quick merge PR only contains relatively simple changes PR: ready for review labels Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hexadecimal strings are still supported

4 participants