diff --git a/db.php b/db.php index 6643331..d8c8788 100644 --- a/db.php +++ b/db.php @@ -842,6 +842,9 @@ public function set_charset( $dbh, $charset = null, $collate = null ) { * This is also the reason why we don't allow certain charsets. See set_charset(). */ public function _real_escape( $string ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore + if ( is_null( $string ) ) { + return $string; + } $escaped = addslashes( (string) $string ); if ( method_exists( get_parent_class( $this ), 'add_placeholder_escape' ) ) { $escaped = $this->add_placeholder_escape( $escaped );