From 3c845709019dce47697b690dc55b111a144e250c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 11 Jan 2022 10:15:06 +0100 Subject: Fix undefined/unset scope in account properties Signed-off-by: Joas Schilling --- lib/private/Accounts/AccountProperty.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/Accounts/AccountProperty.php b/lib/private/Accounts/AccountProperty.php index 4b7f2b0c04c..896dfd247b5 100644 --- a/lib/private/Accounts/AccountProperty.php +++ b/lib/private/Accounts/AccountProperty.php @@ -152,6 +152,7 @@ class AccountProperty implements IAccountProperty { switch ($scope) { case IAccountManager::VISIBILITY_PRIVATE: + case '': return IAccountManager::SCOPE_LOCAL; case IAccountManager::VISIBILITY_CONTACTS_ONLY: return IAccountManager::SCOPE_FEDERATED; -- cgit v1.2.3 From 172be810b8b6d401858333bcc0428dd55fe650ce Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 11 Jan 2022 12:54:41 +0100 Subject: Fix test Signed-off-by: Joas Schilling --- tests/lib/Accounts/AccountPropertyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/Accounts/AccountPropertyTest.php b/tests/lib/Accounts/AccountPropertyTest.php index c2ba96ef8a5..55f83513349 100644 --- a/tests/lib/Accounts/AccountPropertyTest.php +++ b/tests/lib/Accounts/AccountPropertyTest.php @@ -84,8 +84,8 @@ class AccountPropertyTest extends TestCase { [IAccountManager::VISIBILITY_PRIVATE, IAccountManager::SCOPE_LOCAL], [IAccountManager::VISIBILITY_CONTACTS_ONLY, IAccountManager::SCOPE_FEDERATED], [IAccountManager::VISIBILITY_PUBLIC, IAccountManager::SCOPE_PUBLISHED], + ['', IAccountManager::SCOPE_LOCAL], // invalid values - ['', null], ['unknown', null], ['v2-unknown', null], ]; -- cgit v1.2.3