From ca991dbe293fd17b6655d666dd98cd94b708c4fd Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 16 Nov 2023 11:24:52 +0000 Subject: [PATCH] MDL-78849 user: correct logical operator behaviour for guest button. Apart from being banned per MDL-74990, it causes a subtle bug here due to operator precedence. Co-authored-by: Tom Mayfield --- auth/classes/output/login.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth/classes/output/login.php b/auth/classes/output/login.php index 703afa2c9e1..3800cb72ecc 100644 --- a/auth/classes/output/login.php +++ b/auth/classes/output/login.php @@ -90,7 +90,7 @@ class login implements renderable, templatable { $languagedata = new \core\output\language_menu($PAGE); $this->languagemenu = $languagedata->export_for_action_menu($OUTPUT); - $this->canloginasguest = $CFG->guestloginbutton and !isguestuser(); + $this->canloginasguest = $CFG->guestloginbutton && !isguestuser(); $this->canloginbyemail = !empty($CFG->authloginviaemail); $this->cansignup = $CFG->registerauth == 'email' || !empty($CFG->registerauth); if ($CFG->rememberusername == 0) {