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

FILTER_SANITIZE_STRING deprecation notice with PHP 8.1 #721

Closed
4 tasks
vmanthos opened this issue Apr 13, 2023 · 5 comments · Fixed by #722 or #735
Closed
4 tasks

FILTER_SANITIZE_STRING deprecation notice with PHP 8.1 #721

vmanthos opened this issue Apr 13, 2023 · 5 comments · Fixed by #722 or #735
Assignees
Labels
priority: medium Issues which are important, but no one will go out of business. type: enhancement
Milestone

Comments

@vmanthos
Copy link
Contributor

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version ✔️
  • Used the search feature to ensure that the bug hasn’t been reported before ✔️

Describe the bug

PHP Deprecated:  Constant FILTER_SANITIZE_STRING is deprecated in /var/www/example.com/htdocs/wp-content/plugins/imagify/inc/classes/class-imagify-views.php on line 511

To Reproduce

Steps to reproduce the behavior:

  1. Use PHP 8.1.
  2. Activate Imagify.
  3. Visit the media library page: /wp-admin/upload.php
  4. See the notice in the debug.log.

Expected behavior

No deprecation notices should be there when using Imagify with PHP 8.1.

Additional context

FILTER_SANITIZE_STRING is used in other places in Imagify's code. Those should be tackled as well.

Backlog Grooming (for WP Media dev team use only)

  • Reproduce the problem
  • Identify the root cause
  • Scope a solution
  • Estimate the effort
@piotrbak piotrbak added type: enhancement priority: medium Issues which are important, but no one will go out of business. labels Apr 13, 2023
@piotrbak piotrbak added this to the 2.1.2 milestone Apr 13, 2023
@remyperona remyperona self-assigned this Apr 14, 2023
@remyperona remyperona added effort [XS] < 1 day of estimated development time and removed needs: grooming labels Apr 14, 2023
@srsimonson
Copy link

srsimonson commented May 3, 2023

similar error also occurs:
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /var/www/my-path/wp-content/plugins/imagify/inc/classes/class-imagify-views.php on line 511

Same steps to reproduce, except when visiting /wp-admin/edit.php or any other custom post type.

@Mai-Saad
Copy link

Mai-Saad commented May 24, 2023

Can see this error (while AS tables are deleted) , using PHP 8.1 latest and fresh install/activation of imagify (trunk 2.1.1)
[24-May-2023 14:30:55 UTC] PHP Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-settings.php on line 134

vmanthos added a commit that referenced this issue May 26, 2023
Fixes #721 Replace usage of `FILTER_SANITIZE_STRING`
@vmanthos
Copy link
Contributor Author

@Tabrisrp I found a couple of issues related to #722:

[22-Jun-2023 09:10:03 UTC] PHP Warning:  Undefined array key "orderby" in /var/www/example.com/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-list-table.php on line 102
[22-Jun-2023 09:10:03 UTC] PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/example.com/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-list-table.php on line 102
[22-Jun-2023 09:10:03 UTC] PHP Warning:  Undefined array key "order" in /var/www/example.com/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-list-table.php on line 103
[22-Jun-2023 09:10:03 UTC] PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/example.com/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-list-table.php on line 103
[22-Jun-2023 09:36:45 UTC] PHP Warning:  Undefined array key "status-filter" in /var/www/example.com/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-list-table.php on line 1034
[22-Jun-2023 09:36:45 UTC] PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/example.com/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-list-table.php on line 1034

To reproduce:

  1. With PHP 8.2 visit the MEDIA > Other media page: /wp-admin/upload.php?page=imagify-files
  2. Check the debug.log.

Can you please look into these? 🙏

@vmanthos vmanthos reopened this Jun 22, 2023
@piotrbak piotrbak removed this from the 2.1.2 milestone Jun 30, 2023
@piotrbak piotrbak added needs: grooming and removed effort [XS] < 1 day of estimated development time labels Jul 11, 2023
@piotrbak
Copy link

@Tabrisrp What do you think it'll be effort for this one?

@alexbogias
Copy link

kind reminder

github-merge-queue bot pushed a commit that referenced this issue Sep 13, 2023
@piotrbak piotrbak added this to the 2.1.2 milestone Sep 18, 2023
@remyperona remyperona mentioned this issue Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium Issues which are important, but no one will go out of business. type: enhancement
Projects
None yet
6 participants