Deprecated FILTER_SANITIZE_STRING
-
Hello,
We got an error on the website, in your WP RSS Aggregator plugin (V 4.23.13):Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /var/www/html/wp-content/plugins/wp-rss-aggregator/src/Handlers/FeedTemplates/PreviewTemplateRedirectHandler.php on line 67 Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/wp-content/plugins/wp-rss-aggregator/src/Handlers/FeedTemplates/PreviewTemplateRedirectHandler.php:67) in /var/www/html/wp-includes/pluggable.php on line 1450 Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/wp-content/plugins/wp-rss-aggregator/src/Handlers/FeedTemplates/PreviewTemplateRedirectHandler.php:67) in /var/www/html/wp-includes/pluggable.php on line 1453
Although this error is Deprecated, FILTER_SANITIZE_STRING, which is used in this plugin, is no longer supported in higher versions of PHP 8.1+ and can cause an error as in this case.
We solved it with a temporary fix in this file
/var/www/html/wp-content/plugins/wp-rss-aggregator/src/Handlers/FeedTemplates/PreviewTemplateRedirectHandler.php
For the fix, we used the recommended function from WP, namely sanitize_text_field.
Line 67:
$previewId = filter_input(INPUT_GET, $this->getParam, FILTER_SANITIZE_STRING);
We replaced:
$previewId = sanitize_text_field(filter_input(INPUT_GET, $this->getParam));
and
Line 87:
$options = filter_input(INPUT_GET, ‘wpra_template_options’, FILTER_SANITIZE_STRING);
We substituted for:
$options = sanitize_text_field(filter_input(INPUT_GET, ‘wpra_template_options’));Please update your plugin to stop this error from occurring.
Thank you.
The page I need help with: [log in to see the link]
The topic ‘Deprecated FILTER_SANITIZE_STRING’ is closed to new replies.