From 02446c17e165e8865ba48ac4d46e6fe81b7a236b Mon Sep 17 00:00:00 2001 From: Michael Milette Date: Wed, 19 Jun 2024 17:15:30 -0400 Subject: [PATCH] Fixed PHP 5.6 and 7.0 compatibility issues. --- CHANGELOG.md | 4 ++++ index.php | 5 +++-- version.php | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfcdf30..516395a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log All notable changes to this project will be documented in this file. +## [3.1.3] - 2024-06-19 (dev) +### Update +- Fixed some compatibility issues with PHP 5.6 and 7.0. + ## [3.1.2] - 2024-04-28 ### Updated - Fixed incorrect error message for invalid DMARC ruf. diff --git a/index.php b/index.php index 1ad8852..4ab8092 100644 --- a/index.php +++ b/index.php @@ -107,7 +107,7 @@ } $lastcroninterval = get_config('tool_task', 'lastcroninterval'); - $expectedfrequency = $CFG->expectedcronfrequency ?? MINSECS; + $expectedfrequency = isset($CFG->expectedcronfrequency) ? $CFG->expectedcronfrequency : MINSECS; $croninfrequent = !$cronoverdue && ($lastcroninterval > ($expectedfrequency + MINSECS) || $lastcron < time() - $expectedfrequency); if ($croninfrequent) { @@ -276,7 +276,8 @@ // Split the host and the port. $host = explode(':', $host . ':25'); // Set default port to 25 in case none was specified. - [$host, $port] = $host; + $host = $host[0]; + $port = $host[1]; $port = (int)$port; // Check for DNS record lookup failure. Skip if host is an IP address. diff --git a/version.php b/version.php index 31eb3c9..cd0b95b 100644 --- a/version.php +++ b/version.php @@ -26,8 +26,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'local_mailtest'; // To check on upgrade, that module sits in correct place. -$plugin->version = 2024042801; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2024061900; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2013040500; // Requires Moodle version 2.5. -$plugin->release = '3.1.2'; +$plugin->release = '3.1.3'; $plugin->maturity = MATURITY_STABLE; $plugin->cron = 0;