From 1d34ce60a6cc6f021f0e9254921e6f33b8bc3cd2 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 26 Mar 2021 10:44:55 +0100 Subject: remove __autoload usage from autoloader for PHP 8 --- PHPMailer-path.patch | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'PHPMailer-path.patch') diff --git a/PHPMailer-path.patch b/PHPMailer-path.patch index 59a0ca5..3b7b330 100644 --- a/PHPMailer-path.patch +++ b/PHPMailer-path.patch @@ -1,7 +1,7 @@ diff -up ./class.phpmailer.php.rpm ./class.phpmailer.php ---- ./class.phpmailer.php.rpm 2016-12-09 11:03:48.000000000 +0100 -+++ ./class.phpmailer.php 2016-12-09 15:03:58.489947280 +0100 -@@ -1475,6 +1475,7 @@ class PHPMailer +--- ./class.phpmailer.php.rpm 2020-03-19 15:29:37.000000000 +0100 ++++ ./class.phpmailer.php 2021-03-26 10:33:39.989407757 +0100 +@@ -1534,6 +1534,7 @@ class PHPMailer public function getSMTPInstance() { if (!is_object($this->smtp)) { @@ -9,7 +9,7 @@ diff -up ./class.phpmailer.php.rpm ./class.phpmailer.php $this->smtp = new SMTP; } return $this->smtp; -@@ -1730,7 +1731,7 @@ class PHPMailer +@@ -1795,7 +1796,7 @@ class PHPMailer ); if (empty($lang_path)) { // Calculate an absolute path so it can work if CWD is not here @@ -18,3 +18,28 @@ diff -up ./class.phpmailer.php.rpm ./class.phpmailer.php } //Validate $langcode if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { +diff -up ./PHPMailerAutoload.php.rpm ./PHPMailerAutoload.php +--- ./PHPMailerAutoload.php.rpm 2021-03-26 10:34:09.218276732 +0100 ++++ ./PHPMailerAutoload.php 2021-03-26 10:34:35.311159763 +0100 +@@ -30,20 +30,4 @@ function PHPMailerAutoload($classname) + } + } + +-if (version_compare(PHP_VERSION, '5.1.2', '>=')) { +- //SPL autoloading was introduced in PHP 5.1.2 +- if (version_compare(PHP_VERSION, '5.3.0', '>=')) { +- spl_autoload_register('PHPMailerAutoload', true, true); +- } else { +- spl_autoload_register('PHPMailerAutoload'); +- } +-} else { +- /** +- * Fall back to traditional autoload for old PHP versions +- * @param string $classname The name of the class to load +- */ +- function __autoload($classname) +- { +- PHPMailerAutoload($classname); +- } +-} ++spl_autoload_register('PHPMailerAutoload', true, true); -- cgit