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

Getting these warnings in debug.log when in UpdraftPlus backend:

[05-Feb-2024 20:51:47 UTC] PHP Deprecated:  htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in ../wp-content/plugins/updraftplus/templates/wp-admin/advanced/site-info.php on line 67

Reason is result of $wpdb->get_var('SELECT @@GLOBAL.sql_mode') can be null depending on server setup and is passed to htmlspecialchars() without checking content of result.

67: $updraftplus_admin->settings_debugrow(__('Current SQL mode:', 'updraftplus'), htmlspecialchars($wpdb->get_var('SELECT @@GLOBAL.sql_mode')));

UpdraftPlus 1.23.16, WordPress 6.4.3, 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