From 99f5b6019a50be15b0d17c2e78542b45eac87316 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 21 Jul 2020 12:56:40 +0000 Subject: [PATCH] Mail: Make sure the `PHPMailer` class is only required once if a plugin requires `wp-includes/class-phpmailer.php` directly. Follow-up to [48033]. Props david.binda. Fixes #50716. See #41750. git-svn-id: https://develop.svn.wordpress.org/trunk@48530 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-phpmailer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-phpmailer.php b/src/wp-includes/class-phpmailer.php index ff31db2f69..fe054f6879 100644 --- a/src/wp-includes/class-phpmailer.php +++ b/src/wp-includes/class-phpmailer.php @@ -12,8 +12,8 @@ if ( function_exists( '_deprecated_file' ) ) { ); } -require __DIR__ . '/PHPMailer/PHPMailer.php'; -require __DIR__ . '/PHPMailer/Exception.php'; +require_once __DIR__ . '/PHPMailer/PHPMailer.php'; +require_once __DIR__ . '/PHPMailer/Exception.php'; class_alias( PHPMailer\PHPMailer\PHPMailer::class, 'PHPMailer' ); class_alias( PHPMailer\PHPMailer\Exception::class, 'phpmailerException' );