wp-media / imagify-plugin

Speed up your website with lighter images without losing quality.
https://imagify.io
69 stars 24 forks source link

Fixes #721 Replace usage of `FILTER_SANITIZE_STRING` #722

Closed Tabrisrp closed 1 year ago

Tabrisrp commented 1 year ago

Fixes #721

Replace usage of FILTER_SANITIZE_STRING by htmlspecialchars(), as per the official PHP docs recommendation.

vmanthos commented 1 year ago

@Tabrisrp I checked the PR and the issue described in the original issue is resolved. :clap:

I'm seeing the following notices in the debug.log:

PHP Warning:  Undefined array key "page" in /var/www/example.com/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-views.php on line 468
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-views.php on line 468

These are there both with PHP 8.1 & 8.2.

To reproduce:

  1. Visit the media library page: /wp-admin/upload.php
  2. See the notice in the debug.log.

Can you please look into this? :pray:

Tabrisrp commented 1 year ago

@vmanthos Good catch, fixed it!