Skip to content

Commit e06d7cd

Browse files
committed
Fix passing null to strlen
$filter can be null as it's the default value passed in ContactsMenuController. On PHP 8.1 : strlen(): Passing null to parameter #1 ($string) of type string is deprecated Signed-off-by: Thomas Citharel <tcit@tcit.fr>
1 parent 0fdb415 commit e06d7cd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/private/Contacts/ContactsMenu/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getEntries(IUser $user, $filter) {
6666
$maxAutocompleteResults = max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT));
6767
$minSearchStringLength = $this->config->getSystemValueInt('sharing.minSearchStringLength', 0);
6868
$topEntries = [];
69-
if (strlen($filter) >= $minSearchStringLength) {
69+
if ($filter && strlen($filter) >= $minSearchStringLength) {
7070
$entries = $this->store->getContacts($user, $filter, $maxAutocompleteResults);
7171

7272
$sortedEntries = $this->sortEntries($entries);

0 commit comments

Comments
 (0)