Skip to content

Commit e728837

Browse files
committed
Force integers in UID
1 parent ed81c6d commit e728837

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Connection/ImapQueryBuilder.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,9 @@ public function header(string $header, string $value): static
232232
*/
233233
public function uid(int|string|array $uid): static
234234
{
235-
return $this->where(
236-
ImapSearchKey::Uid,
237-
new RawQueryValue(implode(',', (array) $uid))
238-
);
235+
return $this->where(ImapSearchKey::Uid, new RawQueryValue(
236+
Str::set(array_map('intval', (array) $uid))
237+
));
239238
}
240239

241240
/**

tests/Unit/Connection/ImapQueryBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function (ImapQueryBuilder $q) {
240240
test('compiles multiple UID values without quotes', function () {
241241
$builder = new ImapQueryBuilder;
242242

243-
$builder->uid([2, 3]);
243+
$builder->uid([2, 3, 5]);
244244

245245
expect($builder->toImap())->toBe('UID 2,3');
246246
});

0 commit comments

Comments
 (0)