Repository navigation
fix: ensure base_convert() is type int before division - #68389
Conversation
a006518 to
88ffc64
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hex strings are already constrained by the regular expressions to non-negative values, so `absint()` adds nothing over a plain integer cast. Using `(int)` matches the adjacent `base_convert()` calls and keeps `WP_Duotone_Gutenberg::colord_parse_hex()` identical to `WP_Duotone::colord_parse_hex()` in WordPress core, which made the same fix in r61247. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the |
|
🤖 Comment by Claude Opus 5.5 Trunk was merged in, and |
What?
This PR fixes several issues of string-number division in duotone-related functionality, due to the direct use of
base_convert()in the operation (which returns a numericstring).Why?
While this issue was surfaced by PHPStan (via #66693) it can be remediated independently as part of #66598
How?
absint()was used over casting for readability, since these are inline mathematical expressions.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast