From 6ec03d254bd4312698845a314f898cd5ade34303 Mon Sep 17 00:00:00 2001 From: Xheni Myrtaj Date: Sat, 26 May 2018 20:44:57 +0200 Subject: [PATCH] add compatibility to PHP 7.2 and higher (#329) * adding compatibility to PHP 7.2 and higher Signed-off-by: Xheni Myrtaj * fix the required php version Signed-off-by: Xheni Myrtaj --- .travis.yml | 5 +++++ composer.json | 2 +- .../admin/PHPMailer/PHPMailerAutoload.php | 21 ++++--------------- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index a792e86cb..a08ea3250 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,11 @@ matrix: env: BROWSER=goutte - php: '7.1' env: BROWSER=chrome + - php: '7.2' + env: BROWSER=goutte + - php: '7.2' + env: BROWSER=chrome + notifications: slack: diff --git a/composer.json b/composer.json index 07d06e95e..8f9278188 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "minimum-stability": "dev", "require": { - "php": ">= 5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { "behat/mink": "@stable", diff --git a/public_html/lists/admin/PHPMailer/PHPMailerAutoload.php b/public_html/lists/admin/PHPMailer/PHPMailerAutoload.php index c9674c675..b024d073b 100644 --- a/public_html/lists/admin/PHPMailer/PHPMailerAutoload.php +++ b/public_html/lists/admin/PHPMailer/PHPMailerAutoload.php @@ -32,21 +32,8 @@ 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'); - } +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'); +} \ No newline at end of file