diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2022-03-24 14:03:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 14:03:13 +0100 |
commit | fbf1334dc8c192ebdd335663cacfb810daf4d841 (patch) | |
tree | 2796e35ab533fe2b0c80ad2c90315d6c1de6ad1b /lib/private/Contacts | |
parent | c9ea2363b1e50748b7c85f1e14b036c3d92cc31a (diff) | |
parent | 0456f61c1cab907cbd582cfbf3e942460933f537 (diff) | |
download | nextcloud-server-fbf1334dc8c192ebdd335663cacfb810daf4d841.tar.gz nextcloud-server-fbf1334dc8c192ebdd335663cacfb810daf4d841.zip |
Merge pull request #31655 from nextcloud/fix-passing-null-to-strlen
Fix passing null to strlen
Diffstat (limited to 'lib/private/Contacts')
-rw-r--r-- | lib/private/Contacts/ContactsMenu/ContactsStore.php | 4 | ||||
-rw-r--r-- | lib/private/Contacts/ContactsMenu/Manager.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php index 5b7a942a244..0ac388ce00a 100644 --- a/lib/private/Contacts/ContactsMenu/ContactsStore.php +++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php @@ -107,7 +107,7 @@ class ContactsStore implements IContactsStore { } $allContacts = $this->contactsManager->search( - $filter ?: '', + $filter ?? '', [ 'FN', 'EMAIL' @@ -146,7 +146,7 @@ class ContactsStore implements IContactsStore { * * @param IUser $self * @param Entry[] $entries - * @param string $filter + * @param string|null $filter * @return Entry[] the filtered contacts */ private function filterContacts( diff --git a/lib/private/Contacts/ContactsMenu/Manager.php b/lib/private/Contacts/ContactsMenu/Manager.php index cea67735da5..73a5a475d85 100644 --- a/lib/private/Contacts/ContactsMenu/Manager.php +++ b/lib/private/Contacts/ContactsMenu/Manager.php @@ -59,14 +59,14 @@ class Manager { /** * @param IUser $user - * @param string $filter + * @param string|null $filter * @return array */ public function getEntries(IUser $user, $filter) { $maxAutocompleteResults = max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT)); $minSearchStringLength = $this->config->getSystemValueInt('sharing.minSearchStringLength', 0); $topEntries = []; - if (strlen($filter) >= $minSearchStringLength) { + if (strlen($filter ?? '') >= $minSearchStringLength) { $entries = $this->store->getContacts($user, $filter, $maxAutocompleteResults); $sortedEntries = $this->sortEntries($entries); |