Closed psiberx closed 2 years ago
Environment:
Describe the bug Imap::sort() throws exceptions when there is no error because it incorrectly handles the result of imap_sort() call.
Imap::sort()
imap_sort()
This check:
if (!$result) { throw new UnexpectedValueException('Could not sort messages!', 0, self::HandleErrors(\imap_errors(), 'imap_sort')); }
Should be replaced with:
if ($result === false) { throw new UnexpectedValueException('Could not sort messages!', 0, self::HandleErrors(\imap_errors(), 'imap_sort')); }
https://www.php.net/manual/en/function.imap-sort.php
To Reproduce Call Imap::sort() with criteria that should return an empty set.
Expected behavior No exception.
Environment:
Describe the bug
Imap::sort()
throws exceptions when there is no error because it incorrectly handles the result ofimap_sort()
call.This check:
Should be replaced with:
https://www.php.net/manual/en/function.imap-sort.php
To Reproduce Call
Imap::sort()
with criteria that should return an empty set.Expected behavior No exception.