PHP Deprecated: strtolower(): Passing null to parameter #1 …

[ad_1]

Getting these entries in debug.log

[03-Oct-2024 11:43:43 UTC] PHP Deprecated:  strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in .../wp-content/plugins/newsletter/includes/module-base.php on line 964

This is the code:

963:    static function sanitize_gender($gender) {
964: $gender = trim(strtolower($gender));
965: if (empty($gender)) {
966: return 'n';
967: }

Seems the problem is caused when no gender is used so $gender is null before this function call.

Suggested fix: Check for null in function before using strtolower() and trim().

Newsletter 8.5.2, WordPress 6.3.5, PHP 8.1.x

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer