- This topic has 4 replies, 3 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
November 24, 2022 at 1:44 pm #2431875
roadlink
Hi there,
I have like thousands of lines in error.log file about this function.
PHP Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /wordpress/mu-plugins/atomic-platform.php on line 559I have checked with hosting and they told me that it is related with my theme.
I have searched for FILTER_SANITIZE_STRING in theme files and find below results.generatepress\inc\meta-box.php (4 hits) Line 231: $sidebar_layout_value = filter_input( INPUT_POST, $sidebar_layout_key, FILTER_SANITIZE_STRING ); Line 240: $footer_widget_value = filter_input( INPUT_POST, $footer_widget_key, FILTER_SANITIZE_STRING ); Line 250: $page_builder_container_value = filter_input( INPUT_POST, $page_builder_container_key, FILTER_SANITIZE_STRING ); Line 261: $disable_content_title_value = filter_input( INPUT_POST, $disable_content_title_key, FILTER_SANITIZE_STRING );here are some search results about this.
https://stackoverflow.com/questions/69207368/constant-filter-sanitize-string-is-deprecated
https://laxmariappan.com/filter_sanitize_string-is-deprecated-what-to-use-instead/November 24, 2022 at 1:56 pm #2431888roadlink
Another plugin solved it like below according to their comment.
/* * Replacer for FILTER_SANITIZE_STRING deprecated with PHP 8.1 */ public static function filter_string_polyfill(string $string): string { $str = preg_replace('/\x00|<[^>]*>?/', '', $string); return str_replace(["'", '"'], [''', '"'], $str); } // end of filter_string_polyfill()November 24, 2022 at 2:26 pm #2431926Leo
StaffCustomer SupportHi there,
Can you confirm that you are using the latest versions of the theme and premium plugin?
https://docs.generatepress.com/article/generatepress-and-gp-premium/The initial error doesn’t look like it’s related to the theme.
Can you disable all non-GP plugins to test?
Let me know 🙂
November 24, 2022 at 11:08 pm #2432304roadlink
Hi Leo,
Yes both GP and GPP are latest versions.
FILTER_SANITIZE_STRING is deprecated and this file still has it. generatepress\inc\meta-box.php
I don’t see any point to disable others plugins and check again.
November 25, 2022 at 3:56 am #2432709David
StaffCustomer SupportHi there,
thanks for reporting that we will take a look at getting that replaced.
-
AuthorPosts
- You must be logged in to reply to this topic.