barbushin / php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)
MIT License
1.66k stars 457 forks source link

[BUG] Mailbox::getMailsInfo throw exception on long array #658

Open PawelBichalski opened 2 years ago

PawelBichalski commented 2 years ago

Environment (please complete the following information):

Describe the bug Mailbox::getMailsInfo throw Argument 1 passed to PhpImap\Imap::fetch_overview() did not appear to be a valid message id range or sequence! exception on long array. This is because preg_match return false on long string. http://sandbox.onlinephpfunctions.com/code/b5a6921f9b5beef87fee5bb6c25a359ba8b76702

To Reproduce Steps to reproduce the behavior.

The used code:

$mailbox = new Mailbox();
$mailbox->getMailsInfo(range(1, 8193));

Screenshots / Outputs image

Additional context https://github.com/php/php-src/issues/8021