Deprecated FILTER_SANITIZE_STRING in WP Form

Hey There,

I am facing a problem, where a filter, used in the WP Form, seems to be deprecated since PHP > 8.0.22.

I am using local to develop a site and running the PHP Version 8.0.22 works well, but when changing to 8.1.9 I get the following error message when submitting the form:

Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /Users/wolfganghartl/Local Sites/playground/app/public/wp-content/plugins/stern_events/inc/wp_simple_form_mailer.php on line 93

I guess there’s no possibility to change the generated file without overriding it on every export, right @matjaz ?! :wink:

Cheers
Wolfgang

1 Like

@Wolfgang.Hartl I replaced FILTER_SANITIZE_STRING the with htmlspecialchars() as suggested by PHP docs https://www.php.net/manual/en/filter.filters.sanitize.php:

$key = htmlspecialchars($key);
$value = htmlspecialchars($value);

This change will be out in the next update, coming soon.

Thanks, Matjaz

2 Likes

Awesome - Thanks a lot! :slight_smile:

A few more deprecation warnings in PHP 8.1 and 8.2

Bug report added:
Deprecation in Smart Nav Walker with PHP 8.1 - General / Bug Reports - Pinegrow Community Forum

1 Like