Skip to content

Conversation

@wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Nov 7, 2025

Changes proposed in this Pull Request:

We are getting some fatal errors in Grafana related to the inclusion of the display CSS property as a safe style using the safe_style_css filter (includes/payment-methods/class-wc-stripe-upe-payment-gateway.php#290):

PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /wordpress/plugins/woocommerce-gateway-stripe/10.0.1/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php:295
Stack trace:

While the root cause is not known (probably due to another filter overriding the default value), the change in this PR is pretty safe, as it just checks if the default style is an array.

Testing instructions

Code review should be enough.


  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@wjrosa wjrosa self-assigned this Nov 7, 2025
@wjrosa wjrosa marked this pull request as ready for review November 7, 2025 21:47
@wjrosa wjrosa requested review from a team, diegocurbelo and malithsen and removed request for a team November 7, 2025 21:51
Copy link
Member

@diegocurbelo diegocurbelo left a comment

Choose a reason for hiding this comment

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

Makes sense, according to the docs $styles is expected to be a string[]

Copy link
Contributor

@malithsen malithsen left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. LGTM!

@wjrosa wjrosa enabled auto-merge (squash) November 10, 2025 15:28
@wjrosa wjrosa disabled auto-merge November 10, 2025 16:16
@wjrosa wjrosa merged commit d26dfd2 into develop Nov 10, 2025
40 checks passed
@wjrosa wjrosa deleted the fix/fix-style-fatal-error branch November 10, 2025 16:16
@wjrosa wjrosa added this to the 10.1.0 milestone Nov 11, 2025
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.

4 participants