Skip to content

PHP Compat: Set flags for html_entity_decode().#795

Merged
agibson-godaddy merged 2 commits intogodaddy-wordpress:release/6.0.1from
peterwilsoncc:phpcompat-html-entity-decode-flags
Dec 5, 2025
Merged

PHP Compat: Set flags for html_entity_decode().#795
agibson-godaddy merged 2 commits intogodaddy-wordpress:release/6.0.1from
peterwilsoncc:phpcompat-html-entity-decode-flags

Conversation

@peterwilsoncc
Copy link
Copy Markdown
Contributor

Summary

Fixes a couple of PHP Compat issues that I missed in my previous PR:

Details

Changes:

  • Source: html_entity_decode() flags updated to use PHP 8.1+ defaults, fixes PHPCompatibility.ParameterValues.NewHTMLEntitiesFlagsDefault.NotSet
  • Tests: Optional params before required params is deprecated, fixes PHPCompatibility.FunctionDeclarations.RemovedOptionalBeforeRequiredParam.Deprecated80

UI Changes

N/A

QA

?

Setup

Steps

@peterwilsoncc
Copy link
Copy Markdown
Contributor Author

@agibson-godaddy Sorry, I'm not sure if I had an out of date branch or PEBKAC but I missed an item that the PHP Compat sniffs mark with an error code: the change of defaults on html_entity_decode(). I've pushed a fix for the tests directory while I'm about it.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses PHP compatibility issues by updating html_entity_decode() function calls to explicitly use PHP 8.1+ default flags and fixing deprecated optional parameter declarations in test methods.

  • Updates html_entity_decode() to include explicit flags (ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401)
  • Removes default null values from optional parameters that precede required parameters in test methods

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
woocommerce/payment-gateway/admin/class-sv-wc-payment-gateway-admin-order.php Adds explicit flags to html_entity_decode() call for PHP 8.1+ compatibility
tests/integration/API/CacheableAPIBaseTest.php Removes default null values from $filter_value parameters to fix deprecated optional-before-required parameter pattern

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@agibson-godaddy agibson-godaddy mentioned this pull request Dec 5, 2025
2 tasks
@agibson-godaddy agibson-godaddy changed the base branch from master to release/6.0.1 December 5, 2025 13:01
Copy link
Copy Markdown
Contributor

@agibson-godaddy agibson-godaddy 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 -- thank you!

@agibson-godaddy agibson-godaddy merged commit 7733b23 into godaddy-wordpress:release/6.0.1 Dec 5, 2025
5 checks passed
agibson-godaddy added a commit that referenced this pull request Feb 17, 2026
* Version 6.0.1

* PHP Compat: Set flags for html_entity_decode(). (#795)

* Set flags for html_entity_decode() to PHP 8.1 defaults.

* Tests: Optional params must follow required params.

* Update changelog

* Replace usage of deprecated `wc_enqueue_js()` (#800)

* Replace usage of deprecated wc_enqueue_js

* Separate out registration

* Remove dependencies & add doing it wrong check

* Update doing it wrong wording

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add jQuery helper

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Co-authored-by: Ashley Gibson <99189195+agibson-godaddy@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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