Skip to content

Commit af2dffe

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 <[email protected]>
1 parent 0fdb415 commit af2dffe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/private/Contacts/ContactsMenu/Manager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ public function __construct(ContactsStore $store, ActionProviderStore $actionPro
5959

6060
/**
6161
* @param IUser $user
62-
* @param string $filter
62+
* @param string|null $filter
6363
* @return array
6464
*/
6565
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)