From 441bfe74c1d28accdb407ebc33808be1db9d8114 Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 10 Feb 2020 10:22:55 +0100 Subject: [PATCH 1/2] Fix "Deprecated: __autoload() is deprecated" Deprecated: __autoload() is deprecated, use spl_autoload_register() i --- system/libs/phpmailer/PHPMailerAutoload.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/system/libs/phpmailer/PHPMailerAutoload.php b/system/libs/phpmailer/PHPMailerAutoload.php index eaa2e303..70333650 100644 --- a/system/libs/phpmailer/PHPMailerAutoload.php +++ b/system/libs/phpmailer/PHPMailerAutoload.php @@ -30,20 +30,9 @@ 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'); - } +//SPL autoloading was introduced in PHP 5.1.2 +if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + spl_autoload_register('PHPMailerAutoload', true, true); } 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'); } From 4f413eec12d6e7a7fe44d92ad7a949abd282ddbb Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 10 Feb 2020 10:24:23 +0100 Subject: [PATCH 2/2] Update PHPMailerAutoload.php --- system/libs/phpmailer/PHPMailerAutoload.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/system/libs/phpmailer/PHPMailerAutoload.php b/system/libs/phpmailer/PHPMailerAutoload.php index 70333650..e41e8b67 100644 --- a/system/libs/phpmailer/PHPMailerAutoload.php +++ b/system/libs/phpmailer/PHPMailerAutoload.php @@ -30,9 +30,4 @@ function PHPMailerAutoload($classname) } } -//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'); -} +spl_autoload_register('PHPMailerAutoload', true, true);