pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

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 #7202

Open oldrup opened 11 months ago

oldrup commented 11 months ago

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

cmacht commented 9 months ago

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 );
    }
ravimallya commented 2 weeks ago

I'm also getting the same error.

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

image

This is the field setting:

image

Server Info:

Server architecture Linux 6.1.85+ x86_64 Web server nginx/1.24.0 PHP version 8.2.16 (Supports 64bit values) PHP SAPI fpm-fcgi PHP max input variables 1000 PHP time limit 90 PHP memory limit 512M Max input time 60 Upload max filesize 100M PHP post max size 32M cURL version 8.5.0 OpenSSL/3.1.3 Is SUHOSIN installed? No Is the Imagick library available? Yes Are pretty permalinks supported? Yes Current time 2024-09-16T07:01:03+00:00 Current UTC time Monday, 16-Sep-24 07:01:03 UTC Current Server time 2024-09-16T12:31:00+05:30