Skip Navigation

[Resolved] PHP 8.1 PHP Deprecated preg_match and strip_tags wp-includes/formatting-php

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by Christopher Amirian 1 week, 4 days ago.

Assisted by: Christopher Amirian.

Author
Posts
#2694727

Using Toolset with PHP 8.1.23, I get these errors:

PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in  /wp-includes/formatting.php on line 1608
PHP Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in  /wp-includes/formatting.php on line 2274
#2694826

The issue is caused by

\Toolset_Relationship_Driver::get_intermediary_post_type()

passing NULL on line 96.

5min demo: hidden link

formatting.php:1608, remove_accents()
formatting.php:2223, sanitize_title()
element_type.php:63, Toolset_Relationship_Element_Type->__construct()
element_type.php:136, Toolset_Relationship_Element_Type::build_for_post_type()
definition.php:536, Toolset_Relationship_Definition->get_element_type()
Query.php:1111, OTGS\Toolset\Common\Relationships\DatabaseLayer\Version2\AssociationQuery\Query->get_post_type_constraints()
Query.php:231, OTGS\Toolset\Common\Relationships\DatabaseLayer\Version2\AssociationQuery\Query->get_results()
RelatedPosts.php:585, OTGS\Toolset\Common\Interop\Commands\RelatedPosts->get_results()
m2m.php:111, toolset_get_related_posts()
Abstract_Calc.php:995, TK_Closing_Costs\Calc\Abstract_Calc->get_title_fees_item_ids()
Abstract_Calc.php:955, TK_Closing_Costs\Calc\Abstract_Calc->calculate_title_fees_total()
Abstract_Calc.php:944, TK_Closing_Costs\Calc\Abstract_Calc->calculate_totals()
Abstract_Calc.php:585, TK_Closing_Costs\Calc\Abstract_Calc->get_html_result()
Common.php:666, TK_Closing_Costs\Common\Common::gf_calc_form_save_results()
class-wp-hook.php:326, WP_Hook->apply_filters()
class-wp-hook.php:348, WP_Hook->do_action()
plugin.php:517, do_action()
gravityforms.php:7075, gf_do_action()
form_display.php:178, GFFormDisplay::process_form()
gravityforms.php:869, GFForms::maybe_process_form()
class-wp-hook.php:324, WP_Hook->apply_filters()
class-wp-hook.php:348, WP_Hook->do_action()
plugin.php:565, do_action_ref_array()
class-wp.php:830, WP->main()
functions.php:1336, wp()
wp-blog-header.php:16, require()
index.php:17, {main}()
#2694865

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

We are still in the process of handling all deprecation messages in Toolset and for now, even WordPress does not fully support the 8.1.X version of PHP.

The messages you have mentioned do not have any effect on the current workflow of Toolset as it is a message that in the upcoming updates of PHP, the function is used might not work.

So for now we suggest that you do not display the deprecation messages in WordPress wp-config.php

define('WP_DEBUG', false);
define('WP_DEBUG_LOG', false);
define('WP_DEBUG_DISPLAY', false);

Thanks.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.