Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider replacing FILTER_SANITIZE_STRING, since it is deprecated as of PHP 8.1.0 #3056

Closed
anastas10s-afk opened this issue Apr 9, 2024 · 4 comments · Fixed by #3144
Closed
Assignees

Comments

@anastas10s-afk
Copy link
Contributor

Describe the bug
Came across a report on the forums, where the site's logs report the following:
PHP Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-customer.php on line 189

As it appears, it would be beneficial to use htmlspecialchars() instead, as FILTER_SANITIZE_STRING (int) ID of “string” filter is deprecated as of PHP 8.1.0.

Additional context
Per the search results, linked here, it appears in the files:

  • includes/class-wc-stripe-customer.php
  • includes/payment-methods/class-wc-stripe-payment-request.php

Moreover htmlspecialchars() is compatible with current and future PHP versions, as I understand.

For context:

#hc

@anastas10s-afk
Copy link
Contributor Author

cc @a-danae 🙂

@a-danae
Copy link
Contributor

a-danae commented Apr 10, 2024

Ack. Thanks for the heads up @anastas10s-afk ! 🙂

@a-danae a-danae self-assigned this Apr 26, 2024
@mattallan
Copy link
Contributor

Oh sorry @a-danae ! I just found this issue after opening a PR and noticed you assigned yourself to it a month ago. It was only a small change but I hope you weren't also in the middle of fixing it

PR here: #3144

@a-danae
Copy link
Contributor

a-danae commented May 26, 2024

No way, thanks for fixing this @mattallan ! 🙌

@a-danae a-danae removed their assignment May 26, 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
3 participants