[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [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 <6961566d69c62_2c1809347554a@gitlab-sidekiq-low-urgency-cpu-bound-v2-5f6955b989-79sxm.mail>

Benoit Grégoire pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
f95544ce by Sandeep D at 2026-01-09T19:18:48+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
---
* [FIX] TwoFactorAuth: Update default type retrieval logic to handle empty values correctly.

See merge request tikiwiki/tiki!9310


(cherry picked from commit 7593b45f9d55d6609a5ccd7408a53354bb1d0a9e)

Co-authored-by: Sandeep D <sandeep.anandbhai-NHSG37FGo5wS/6/[email protected]>

See merge request tikiwiki/tiki!9331

- - - - -


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/f95544ce4f5d462aab38ee342e5c0c210820ee80

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f95544ce4f5d462aab38ee342e5c0c210820ee80
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.