From a396e14582942b63d560ce4f571cfb5314d0d904 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 26 Oct 2021 19:58:53 +0200 Subject: [PATCH] fix PHP 8.0 error setting up two factor auth key() expects array, null given --- preferences/inc/class.preferences_password.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preferences/inc/class.preferences_password.inc.php b/preferences/inc/class.preferences_password.inc.php index b9ecaf2458..7e8d0c00dd 100644 --- a/preferences/inc/class.preferences_password.inc.php +++ b/preferences/inc/class.preferences_password.inc.php @@ -89,7 +89,7 @@ class preferences_password break; case 'two_factor_auth': - switch(key($content['2fa']['action'])) + switch(key($content['2fa']['action'] ?? [])) { case 'show': $content['2fa'] = $this->generateQRCode($google2fa, false);