Skip to content

Commit

Permalink
Fix search function
Browse files Browse the repository at this point in the history
The behavior of rcube_result_set->next() was changed upstream. This
fixes enumeration within the search() function.
  • Loading branch information
nick-oconnor authored and mstilkerich committed Jun 3, 2024
1 parent 2d8e955 commit 0bf900f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Addressbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,8 @@ public function search($fields, $value, $mode = 0, $select = true, $nocount = fa
$this->page_size = $pageSizeBackup;
}

while (
/** @var ?SaveData $save_data */
$save_data = $result->next()
) {
/** @var ?SaveData $save_data */
foreach ($result as $save_data) {
if ($this->checkPostSearchFilter($save_data, $required, $allMustMatch, $postSearchFilter, $mode)) {

Check failure on line 341 in src/Addressbook.php

View workflow job for this annotation

GitHub Actions / staticanalyses (release-1.4)

PossiblyNullArgument

src/Addressbook.php:341:50: PossiblyNullArgument: Argument 1 of MStilkerich\RCMCardDAV\Addressbook::checkPostSearchFilter cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 341 in src/Addressbook.php

View workflow job for this annotation

GitHub Actions / staticanalyses (release-1.5)

PossiblyNullArgument

src/Addressbook.php:341:50: PossiblyNullArgument: Argument 1 of MStilkerich\RCMCardDAV\Addressbook::checkPostSearchFilter cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 341 in src/Addressbook.php

View workflow job for this annotation

GitHub Actions / staticanalyses (release-1.6)

PossiblyNullArgument

src/Addressbook.php:341:50: PossiblyNullArgument: Argument 1 of MStilkerich\RCMCardDAV\Addressbook::checkPostSearchFilter cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 341 in src/Addressbook.php

View workflow job for this annotation

GitHub Actions / staticanalyses (master)

PossiblyNullArgument

src/Addressbook.php:341:50: PossiblyNullArgument: Argument 1 of MStilkerich\RCMCardDAV\Addressbook::checkPostSearchFilter cannot be null, possibly null value provided (see https://psalm.dev/078)
/** @var array{ID: string} $save_data */
$ids[] = $save_data["ID"];
Expand Down

0 comments on commit 0bf900f

Please sign in to comment.