From afaeaf1529efc267b475235d3c503907a14c2f74 Mon Sep 17 00:00:00 2001 From: TimothyBlynJacobs Date: Fri, 12 Jun 2020 21:10:08 +0000 Subject: [PATCH] External Libraries: Skip deprecated file warning for PHPMailer if the API is not loaded. In [48033] the "class-phpmailer.php" file was deprecated. In test suites, this file is loaded before WordPress in order to setup a mock PHPMailer instance. This means that for test suites that are still loading that file, they'll experience fatal errors due to the undefined "_deprecated_file" function. This commit skips issuing the deprecated file warning if the "_deprecated_file" function is not available. Fixes #50380. Built from https://develop.svn.wordpress.org/trunk@48034 git-svn-id: http://core.svn.wordpress.org/trunk@47801 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-phpmailer.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-phpmailer.php b/wp-includes/class-phpmailer.php index b82f7ff613..796bd379f3 100644 --- a/wp-includes/class-phpmailer.php +++ b/wp-includes/class-phpmailer.php @@ -3,7 +3,9 @@ /** * The PHPMailer class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace. */ -_deprecated_file( basename( __FILE__ ), '5.5.0', WPINC . '/PHPMailer/PHPMailer.php', __( 'The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' ) ); +if ( function_exists( '_deprecated_file' ) ) { + _deprecated_file( basename( __FILE__ ), '5.5.0', WPINC . '/PHPMailer/PHPMailer.php', __( 'The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' ) ); +} require __DIR__ . '/PHPMailer/PHPMailer.php'; class_alias( PHPMailer\PHPMailer\PHPMailer::class, 'PHPMailer' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index b5fe71c745..b1e7bbc1d9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-48033'; +$wp_version = '5.5-alpha-48034'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.