Skip to content

Fix undefined index/array key warning with isset#5351

Closed
jacobcassidy wants to merge 1 commit intoWordPress:trunkfrom
jacobcassidy:main
Closed

Fix undefined index/array key warning with isset#5351
jacobcassidy wants to merge 1 commit intoWordPress:trunkfrom
jacobcassidy:main

Conversation

@jacobcassidy
Copy link
Copy Markdown

Added an if statement with isset() to confirm that $angle_units[ $unit ] is valid before assigning it to $factor to avoid outputting a PHP warning.

Trac ticket: https://core.trac.wordpress.org/ticket/59496

Copy link
Copy Markdown

@ajlende ajlende left a comment

Choose a reason for hiding this comment

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

Looks good to me. The logic tracks with the original JS function. 👍

@swissspidy
Copy link
Copy Markdown
Member

@swissspidy swissspidy closed this Feb 18, 2024
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.

3 participants