From 1114ab3822863f0c029dc470e8870b36a53f0068 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 30 Jul 2024 15:44:40 +0100 Subject: [PATCH] MDL-82643 enrol_self: clarify validation of notification threshold. --- enrol/self/lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/enrol/self/lib.php b/enrol/self/lib.php index 80ad7d48e28..5f905ebe50a 100644 --- a/enrol/self/lib.php +++ b/enrol/self/lib.php @@ -1037,9 +1037,8 @@ class enrol_self_plugin extends enrol_plugin { } } - if (array_key_exists('expirynotify', $data) - && ($data['expirynotify'] > 0 || $data['customint2']) - && $data['expirythreshold'] < 86400) { + // If expirynotify is selected, then ensure the threshold is at least one day. + if (isset($data['expirynotify']) && $data['expirynotify'] > 0 && $data['expirythreshold'] < DAYSECS) { $errors['expirythreshold'] = get_string('errorthresholdlow', 'core_enrol'); }