From 7c71ff6ac58dddd35cefd990e9d733c17b1f42c3 Mon Sep 17 00:00:00 2001 From: Drk Hgdrn Date: Fri, 11 Sep 2020 12:05:33 +0200 Subject: [PATCH] PHPMailer moved to a different location and provides a different get_class() --- wp-db-backup.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-db-backup.php b/wp-db-backup.php index eb23d0b..6e0d94a 100755 --- a/wp-db-backup.php +++ b/wp-db-backup.php @@ -951,6 +951,9 @@ function send_mail( $to, $subject, $message, $diskfile) { extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message' ) ) ); if ( !is_object( $phpmailer ) || ( strtolower(get_class( $phpmailer )) != 'phpmailer' ) ) { + // WordPress 5.5: PHPMailer moved from class-phpmail.php to PHPMailer/PHPMailer.php + if ( file_exists( ABSPATH . WPINC . '/PHPMailer/PHPMailer.php' ) ) + require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php'; if ( file_exists( ABSPATH . WPINC . '/class-phpmailer.php' ) ) require_once ABSPATH . WPINC . '/class-phpmailer.php'; if ( file_exists( ABSPATH . WPINC . '/class-smtp.php' ) ) @@ -960,7 +963,12 @@ function send_mail( $to, $subject, $message, $diskfile) { } // try to use phpmailer directly (WP 2.2+) - if ( is_object( $phpmailer ) && ( strtolower(get_class( $phpmailer )) == 'phpmailer' ) ) { + if ( is_object( $phpmailer ) && + ( + ( strtolower(get_class( $phpmailer )) == 'phpmailer' ) + || ( strtolower(get_class( $phpmailer )) == 'phpmailer\phpmailer\phpmailer' ) + ) + ) { // Get the site domain and get rid of www. $sitename = $this->get_sitename();