From 87760299a37f26bc5b96a9dc4f8fc5e1fddc15ee Mon Sep 17 00:00:00 2001 From: Greg Post Date: Mon, 20 May 2024 16:31:26 -0500 Subject: [PATCH 1/2] Update ProfileManager.php Confirms if 'accessibilityPref' is set in user's dynamic properties and sets AccessibilityPreference to false by default if not. --- classes/ProfileManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/ProfileManager.php b/classes/ProfileManager.php index 4ffad059bf..70ecc0f7dd 100644 --- a/classes/ProfileManager.php +++ b/classes/ProfileManager.php @@ -1083,7 +1083,7 @@ public function getAccessibilityPreference($uid){ $dynPropArr = $this->getDynamicProperties($uid); if($dynPropArr){ - $returnVal = $dynPropArr['accessibilityPref'] == 1? true: false; + $returnVal = (isset($dynPropArr['accessibilityPref'])) ? $dynPropArr['accessibilityPref'] : false; } return $returnVal; } From dded699264507418ce8d9abc343e7bcbc79aefae Mon Sep 17 00:00:00 2001 From: Greg Post Date: Mon, 20 May 2024 18:25:12 -0500 Subject: [PATCH 2/2] Update ProfileManager.php correct casting string as bool. --- classes/ProfileManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/ProfileManager.php b/classes/ProfileManager.php index 70ecc0f7dd..8740327046 100644 --- a/classes/ProfileManager.php +++ b/classes/ProfileManager.php @@ -1082,8 +1082,8 @@ public function getAccessibilityPreference($uid){ $returnVal = false; $dynPropArr = $this->getDynamicProperties($uid); - if($dynPropArr){ - $returnVal = (isset($dynPropArr['accessibilityPref'])) ? $dynPropArr['accessibilityPref'] : false; + if($dynPropArr && isset($dynPropArr['accessibilityPref'])){ + $returnVal = ($dynPropArr['accessibilityPref'] === '1') ? true : false; } return $returnVal; }