PHP 8.1: Uncaught TypeError: mysqli_real_escape_string()
-
Hey
Thanks for great plugin.Ubuntu Server 22.04
PHP 8.1 via fpm
MariaDB 10.6.7
Wordpress: 6.0 with custom theme
WP Cerber Security 9.0Once a while I got problem in logs:
[Mon Jun 13 10:54:45.706995 2022] [proxy_fcgi:error] [pid 24688:tid 139814875690560] [client 20.127.x.x:60062] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: mysqli_real_escape_string(): Argument #1 ($mysql) must be of type mysqli, null given in /var/www/MYDOMAIN.YY/wp-content/plugins/wp-cerber/cerber-common.ph p:2477\nStack trace:\n#0 /var/www/MYDOMAIN.YY/wp-content/plugins/wp-cerber/cerber-common.php(2477): mysqli_real_escape_string()\n#1 /var/www/MYDOMAIN.YY/wp-con tent/plugins/wp-cerber/cerber-common.php(2935): cerber_real_escape()\n#2 /var/www/MYDOMAIN.YY/wp-content/plugins/wp-cerber/cerber-lab.php(734): cerber_update_set()\n# 3 /var/www/MYDOMAIN.YY/wp-content/plugins/wp-cerber/cerber-lab.php(828): lab_get_key()\n#4 /var/www/MYDOMAIN.YY/wp-content/plugins/wp-cerber/cerber-settings.ph p(2330): lab_lab()\n#5 /var/www/MYDOMAIN.YY/wp-content/plugins/wp-cerber/cerber-ds.php(877): crb_get_settings()\n#6 /var/www/MYDOMAIN.YY/wp-content/plugins/wp- cerber/cerber-load.php(137): require_once('...')\n#7 /var/www/MYDOMAIN.YY/wp-content/plugins/wp-cerber/wp-cerb...', referer: bing.com
This is code:
if ( $db = cerber_get_db() ) { return mysqli_real_escape_string( $db->dbh, $str ); }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘PHP 8.1: Uncaught TypeError: mysqli_real_escape_string()’ is closed to new replies.