preg_replace error not showing forms
-
Hi there,
We are having some troubles with the plugin, we use to work with this plugin in several sites, but now a day are having some troubles when the hosting works with PHP 7.
The Forms are hiddens or sometimes not even load, and when we activate to show errors found this:Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /var/www/site/wp-content/plugins/contact-form-7-3rd-party-integration/hidden.php on line 46
The line is this:
$brform = preg_replace(‘/<p>(<input\stype=”hidden”(?:.*?))<\/p>/isme’, “‘<div class=\’hidden\’ style=\’display:none;\’>’.\”\n\”.str_replace(‘<br>’, ”, str_replace(‘<br />’, ”, stripslashes_deep(‘\\1’))).\”\n\”.'</div>'”, $form);When i remove the /e parameter in /isme the form start showing perfectly.
According to php.net documentation of preg_replace function:
https://php.net/manual/en/function.preg-replace.php
As of PHP 5.5.0 E_DEPRECATED level error is emitted when passing in the “\e” modifier. As of PHP 7.0.0 E_WARNING is emitted in this case and “\e” modifier has no effect.Its possible to fix this and upload a new version compatible with php7?
- The topic ‘preg_replace error not showing forms’ is closed to new replies.