From 7ab09932656d7f36bdae6088b3c0bea4531f499c Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Thu, 21 Sep 2017 19:27:59 +0200 Subject: [PATCH] MDL-53169 database: use bound empty strings for cross-db --- lib/enrollib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/enrollib.php b/lib/enrollib.php index e23eb1adaa2..6077d599be9 100644 --- a/lib/enrollib.php +++ b/lib/enrollib.php @@ -658,7 +658,8 @@ function enrol_get_my_courses($fields = null, $sort = 'visible DESC,sortorder AS $courseidsql .= " SELECT DISTINCT e.courseid FROM {enrol} e - WHERE e.enrol = 'guest' AND e.password = '' AND e.status = :enabled2"; + WHERE e.enrol = 'guest' AND e.password = :emptypass AND e.status = :enabled2"; + $params['emptypass'] = ''; $params['enabled2'] = ENROL_INSTANCE_ENABLED; // Include courses where the current user is currently using guest access (may include -- 2.43.0