Skip to content

fix: ensure base_convert() is type int before division#68389

Open
justlevine wants to merge 1 commit intoWordPress:trunkfrom
justlevine:fix/baseconvert-division
Open

fix: ensure base_convert() is type int before division#68389
justlevine wants to merge 1 commit intoWordPress:trunkfrom
justlevine:fix/baseconvert-division

Conversation

@justlevine
Copy link
Contributor

@justlevine justlevine commented Dec 30, 2024

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 numeric string).

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

Before After

@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: justlevine <justlevine@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added the [Type] Code Quality Issues or PRs that relate to code quality label Jan 14, 2025
@justlevine justlevine force-pushed the fix/baseconvert-division branch from a006518 to 88ffc64 Compare April 18, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants