pods icon indicating copy to clipboard operation
pods copied to clipboard

Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated iin /wp-content/plugins/pods/includes/data.php on line 1548

Open oldrup opened this issue 2 years ago • 1 comments

Description

When creating a new post with a website field, this deprecation warning is being shown:

image

Also, when I in fact insert an URL, a rogue colon (highlighted in yellow) is inserted after the domain, and a hashtag is appended.

image

My website field options are per default:

image

Is that something you can reproduce

Version

3.0.6

Testing Instructions

No response

Screenshots / Screencast

No response

Possible Workaround

Setting the Website field format to "no format" removes the ekstra colon and the hasttag from the backend view.

Site Health Information

PHP 8.1

Pods Package

No response

oldrup avatar Oct 12 '23 07:10 oldrup

I'm facing the same deprecation warning, however I'm not getting colons and hashes.

I think I fixed it but am not PHP-savvy enough to make a Pull Request. Passing a Null value instead of string seems to have been deprecated in PHP 8.1 and should be fixed by type casting with (string) in the offending line.

function pods_mb_strlen( $string ) {
	if ( function_exists( 'mb_strlen' ) ) {
		return mb_strlen( (string) $string );
	}

cmacht avatar Dec 27 '23 02:12 cmacht