From 0df4a06a97cb568973e5c5ff3d0b97bc5dc6dbc2 Mon Sep 17 00:00:00 2001 From: Brendan Heywood Date: Sat, 10 Oct 2020 19:24:38 +1100 Subject: [PATCH] MDL-69910 calendar: Fix export exception when both params are sent --- calendar/export_execute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calendar/export_execute.php b/calendar/export_execute.php index a06f3286cc6..9f44a6e2241 100644 --- a/calendar/export_execute.php +++ b/calendar/export_execute.php @@ -18,7 +18,7 @@ if (empty($CFG->enablecalendarexport)) { $checkuserid = !empty($userid) && $user = $DB->get_record('user', array('id' => $userid), 'id,password'); //allowing for fallback check of old url - MDL-27542 $checkusername = !empty($username) && $user = $DB->get_record('user', array('username' => $username), 'id,password'); -if (!$checkuserid && !$checkusername) { +if ((!$checkuserid && !$checkusername) || !$user) { //No such user die('Invalid authentication'); }