strlen() error – CF7CF 2.5.9 – PHP 8.2
-
Jules, thank you for your highly useful plugin~
With CF7CF 2.5.9 + PHP 8.2 (+ WordPress 6.7.2) I’m getting this error message in my server log and failures of the plugin to complete:
PHP Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /.../wp-content/plugins/cf7-conditional-fields/cf7cf.php on line 434That source code reads:
433: function wpcf7cf_endswith($string, $test) {
434: $strlen = strlen($string);Clearly what’s required is a forced string type or alternative. There’s discussion of this aspect of strlen() in the User Contributor Notes at https://www.php.net/manual/en/function.strlen.php#127814
Although this is the only such incompatibility I’ve encountered between CF7CF 2.5.9 and PHP 8.2, strlen() is one of many functions that have developed backward vulnerabilities since PHP 7.2.
Happy coding,
Paul
The topic ‘strlen() error – CF7CF 2.5.9 – PHP 8.2’ is closed to new replies.