[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] TwoFactorAuth: Update default type retrieval logic to handle empty values correctly

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <695fc663ded67_2c18075489114@gitlab-sidekiq-low-urgency-cpu-bound-v2-7bf775f96c-d89dh.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
7593b45f by Sandeep D at 2026-01-08T14:50:46+00:00
[FIX] TwoFactorAuth: Update default type retrieval logic to handle empty values correctly
---
* [FIX] TwoFactorAuth: Update default type retrieval logic to handle empty values correctly.

See merge request tikiwiki/tiki!9310

- - - - -


1 changed file:

- lib/core/TwoFactorAuth/TwoFactorAuth.php


Changes:

=====================================
lib/core/TwoFactorAuth/TwoFactorAuth.php
=====================================
@@ -27,8 +27,8 @@ class TwoFactorAuth
     {
         global $prefs;
 
-        // If not set, always default to the default type
-        return (string) $prefs['twoFactorAuthType'] ?? self::DEFAULT_2FA;
+        // If not set or empty, always default to the default type
+        return $prefs['twoFactorAuthType'] ?: self::DEFAULT_2FA;
     }
 
     public static function getTwoFactorAuth()



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/7593b45f9d55d6609a5ccd7408a53354bb1d0a9e

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/7593b45f9d55d6609a5ccd7408a53354bb1d0a9e
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.