Skip to content

fix: cast $match[1] to float in WP_DuotoneGutenberg::colord_parse_hsla_string()#68405

Open
justlevine wants to merge 1 commit intoWordPress:trunkfrom
justlevine:fix/string-param_colord_parse_hue
Open

fix: cast $match[1] to float in WP_DuotoneGutenberg::colord_parse_hsla_string()#68405
justlevine wants to merge 1 commit intoWordPress:trunkfrom
justlevine:fix/string-param_colord_parse_hue

Conversation

@justlevine
Copy link
Contributor

What?

This PR fixes an issue in WP_Duotone_Gutenberg::colord_parse_hsla_string() where the string results of preg_match() are passed to ::colord_parse_hue() which expects a float for its first parameter.

Why?

While this issue was surfaced by PHPStan (via #66693) it can be remediated independently as part of #66598

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

Before After

@github-actions
Copy link

github-actions bot commented Dec 30, 2024

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>
Co-authored-by: carolinan <poena@git.wordpress.org>

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

@carolinan carolinan added the [Type] Code Quality Issues or PRs that relate to code quality label Jan 27, 2025
@carolinan carolinan added the Needs PHP backport Needs PHP backport to Core label Jan 27, 2025
@carolinan
Copy link
Contributor

@justlevine justlevine force-pushed the fix/string-param_colord_parse_hue branch from 5a08e56 to 265654d Compare April 18, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs PHP backport Needs PHP backport to Core [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