PHP Compat: Set flags for html_entity_decode().#795
Conversation
|
@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 |
There was a problem hiding this comment.
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
nullvalues 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
left a comment
There was a problem hiding this comment.
Looks good to me -- thank you!
7733b23
into
godaddy-wordpress:release/6.0.1
* 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>
Summary
Fixes a couple of PHP Compat issues that I missed in my previous PR:
Details
Changes:
html_entity_decode()flags updated to use PHP 8.1+ defaults, fixesPHPCompatibility.ParameterValues.NewHTMLEntitiesFlagsDefault.NotSetPHPCompatibility.FunctionDeclarations.RemovedOptionalBeforeRequiredParam.Deprecated80UI Changes
N/A
QA
?
Setup
Steps