From 4195572563cd85d10cc40fffa918ac82eac4d6c2 Mon Sep 17 00:00:00 2001 From: plegall Date: Fri, 21 Jun 2019 15:02:02 +0200 Subject: [PATCH] fixes #904 avoid warnings on PHP 7.2+ with PHPMailer (without updating PHPMailer) --- include/functions_mail.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php index b70b6dc4f..2b5466809 100644 --- a/include/functions_mail.inc.php +++ b/include/functions_mail.inc.php @@ -605,7 +605,14 @@ function pwg_mail($to, $args=array(), $tpl=array()) $conf_mail = get_mail_configuration(); } - include_once(PHPWG_ROOT_PATH.'include/phpmailer/PHPMailerAutoload.php'); + // PHPMailer autoloader shows warnings with PHP 7.2. Solution to upgrade to PHPMailer 6 + // implies requiring PHP 5.5, which is bigger than current requirement for Piwigo. + // + // include_once(PHPWG_ROOT_PATH.'include/phpmailer/PHPMailerAutoload.php'); + // + // replace by direct include of the classes: + include_once(PHPWG_ROOT_PATH.'include/phpmailer/class.smtp.php'); + include_once(PHPWG_ROOT_PATH.'include/phpmailer/class.phpmailer.php'); $mail = new PHPMailer;