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 434
That 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
Warning: preg_match() expects parameter 2 to be string, array given in /wp-includes/class-wp-block-parser.php on line 417
Warning: strlen() expects parameter 1 to be string, array given in /wp-includes/class-wp-block-parser.php on line 489
It seems that it connect to pre_kses:
https://core.trac.www.ads-software.com/ticket/48955
Warning: strlen() expects parameter 1 to be string, object given in /home/www/wordpress/wp-includes/formatting.php on line 3380
Warning: strlen() expects parameter 1 to be string, object given in /home/www/wordpress/wp-includes/formatting.php on line 3380
Warning: strlen() expects parameter 1 to be string, object given in /home/www/wordpress/wp-includes/formatting.php on line 3380
Warning: Cannot modify header information - headers already sent by (output started at /home/www/wordpress/wp-includes/formatting.php:3380) in /home/www/wordpress/wp-admin/admin-header.php on line 9
I’m pretty sure, that the issue is with Graphene, since deactivating all Plugins doesn’t fix the issue, but changing the theme does.
Also the errors only appear in the block editor. When switching to the classig editor via the Classic Editor plugin, everthing is fine.
The rest of the website looks just fine, but I’d still be glad if this was fixed.
Looking forward to your response
awesome plugin, thanks. Was trying to do something similar, but my PHP skills are kinda too non-existent to pull this off right now.
Anyway, I’m trying to add something like what you see in the admin bar of this page. “Hi, {first_name} {avatar}”. It works, except I get a warning every time the {avatar} shortcode is used:
Warning: strlen() expects parameter 1 to be string, object given in /home/***/public_html/wp-includes/formatting.php on line 2875
When I use {first_name} on its own, no problems.
I’ve tried it with a commercial theme, and WP’s 2017 theme – both the same result. Any ideas on how to fix would be much appreciated.
]]>$topic_tags = get_sub_field('topic_related_tags');
$topic_post = get_sub_field('related_post');
$topic_page = get_sub_field('related_page');
$related = (strlen($topic_tags) + strlen($topic_post) + strlen($topic_page ) >0)?true:false;
Using
$related = (isset($topic_tags) && isset($topic_post) && isset($topic_page ))?true:false;
results as true even if there aren’t any sub_fields.
But using (strlen()) gives an error where the title will go.
“Warning: strlen() expects parameter 1 to be string, array given…”
obviously I’m not a php coder but I have exhausted my google skills trying to figure it out.
]]>My programming skills are pretty limited. I tried around with PHP and “strlen” but didn’t really know where and how to apply it right. Maybe there’s even a way to do this directly in the “Template” window of “W4 Post List”.
Would be amazing if someone with more know how could help me out :).
Here’s a pic to make it more clear.
https://i59.tinypic.com/2dmfb4i.jpg
https://www.ads-software.com/plugins/w4-post-list/
]]>I have prepended all the field tags with “mc4wp-” and the information is being parsed correctly. The checkbox has the laben mc4wp-subscribe.
The information is being sent to Mailchimp and the form is sending the email (which is the purpose of the Fast Secure Contact Form). However, once the fields were utilized for Mailchimp I began to get the message below at submission. It will flash at the top of the page then go away. If I disable the Mailchimp plugin the error goes away. Turn it back on and it reappears.
Everything is working as it should with the information correctly being relayed to Mailchip but the error is being shown. I have verified that the wp-config.php does not have debugging enabled.
Any ideas?
ERROR:
strlen() expects parameter 1 to be a string, array given in /public_html/wp-includes/formatting.php on line 1982
Line 1982 is
// Test for the minimum length the email can be
if ( strlen( $email ) < 3 ) {
/**
* Filter whether an email address is valid.
*
* This filter is evaluated under several different contexts, such as ’email_too_short’,
* ’email_no_at’, ‘local_invalid_chars’, ‘domain_period_sequence’, ‘domain_period_limits’,
* ‘domain_no_periods’, ‘sub_hyphen_limits’, ‘sub_invalid_chars’, or no specific context.
*
* @since 2.8.0
*
* @param bool $is_email Whether the email address has passed the is_email() checks. Default false.
* @param string $email The email address being checked.
* @param string $message An explanatory message to the user.
* @param string $context Context under which the email was tested.
*/
return apply_filters( ‘is_email’, false, $email, ’email_too_short’ );
}
https://www.ads-software.com/plugins/mailchimp-for-wp/
]]>I have prepended all the field tags with “mc4wp-” and the information is being parsed correctly. The checkbox has the tag of mc4wp-subscribe.
The information is being sent to Mailchimp and the form is sending the email (which is the purpose of the Fast Secure Contact Form). However, once the fields were utilized for Mailchimp I began to get the message below at submission. If I disable the Mailchimp plugin the error goes away. Turn it back on and it reappears.
Everything is working as it should but the error is being shown. I have verified that the wp-config.php does not have debugging enabled.
Any ideas?
ERROR:
strlen() expects parameter 1 to be a string, array given in /public_html/wp-includes/formatting.php on line 1982
Line 1982 is
// Test for the minimum length the email can be
if ( strlen( $email ) < 3 ) {
/**
* Filter whether an email address is valid.
*
* This filter is evaluated under several different contexts, such as ’email_too_short’,
* ’email_no_at’, ‘local_invalid_chars’, ‘domain_period_sequence’, ‘domain_period_limits’,
* ‘domain_no_periods’, ‘sub_hyphen_limits’, ‘sub_invalid_chars’, or no specific context.
*
* @since 2.8.0
*
* @param bool $is_email Whether the email address has passed the is_email() checks. Default false.
* @param string $email The email address being checked.
* @param string $message An explanatory message to the user.
* @param string $context Context under which the email was tested.
*/
return apply_filters( ‘is_email’, false, $email, ’email_too_short’ );
}
https://www.ads-software.com/plugins/mailchimp/
]]>On my website, there is an error that comes up just before a commenters name on a post that reads:
Warning: strlen() expects parameter 1 to be string, object given in /home/content/60/10837160/html/ugometrics/web/wp-includes/formatting.php on line 1820
This error is visible on this page but so far that’s the only place I can see it. As for the the piece of code the error is referring to it is as follows:
// Test for the minimum length the email can be
if ( strlen( $email ) < 3 ) {
return apply_filters( 'is_email', false, $email, 'email_too_short' );
}
specifically the “if” line. I also checked for the user on the database and it seems there is no one called “VICTOR”. Does anyone have any idea what the error might mean?
]]>