# Deprecated FILTER\_SANITIZE\_STRING in WP Form

**URL:** <https://forum.pinegrow.com/t/deprecated-filter-sanitize-string-in-wp-form/8262>\
**Category:** Bug Reports\
**Created:** [July 28, 2023, 8:42am UTC](https://forum.pinegrow.com/t/deprecated-filter-sanitize-string-in-wp-form/8262 "2023-07-28T08:42:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wolfgang.Hartl](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/wolfgang.hartl/32/4621_2.png) [@Wolfgang.Hartl](https://forum.pinegrow.com/u/Wolfgang.Hartl)\
**Post date:** [July 28, 2023, 8:42am UTC](https://forum.pinegrow.com/t/deprecated-filter-sanitize-string-in-wp-form/8262/1 "2023-07-28T08:42:32Z")

</div>

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_

 ![Bildschirmfoto 2023-07-28 um 10.42.17](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/a/a4e6a7cbd1a23a03bbfcf9914418276cf4d3fbbf.jpeg)

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

Cheers  
Wolfgang

---

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [July 29, 2023, 6:53am UTC](https://forum.pinegrow.com/t/deprecated-filter-sanitize-string-in-wp-form/8262/2 "2023-07-29T06:53:33Z")

</div>

@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:](https://www.php.net/manual/en/filter.filters.sanitize.php:)

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

```

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

Thanks, Matjaz

---

<div class="post-metadata">

**Author:** ![Wolfgang.Hartl](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/wolfgang.hartl/32/4621_2.png) [@Wolfgang.Hartl](https://forum.pinegrow.com/u/Wolfgang.Hartl)\
**Post date:** [July 29, 2023, 10:35am UTC](https://forum.pinegrow.com/t/deprecated-filter-sanitize-string-in-wp-form/8262/3 "2023-07-29T10:35:22Z")

</div>

Awesome - Thanks a lot! 🙂

---

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [August 3, 2023, 9:53pm UTC](https://forum.pinegrow.com/t/deprecated-filter-sanitize-string-in-wp-form/8262/4 "2023-08-03T21:53:34Z")

</div>

A few more deprecation warnings in PHP 8.1 and 8.2

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/a/a8815177d943bee2d2b025446364f4826cfa0c85.png)

Bug report added:  
[Deprecation in Smart Nav Walker with PHP 8.1 - General / Bug Reports - Pinegrow Community Forum](https://forum.pinegrow.com/t/deprecation-in-smart-nav-walker-with-php-8-1/8282)
