From db8bf0a9e07f906ad5d771142e5873688aff8033 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Tue, 13 Oct 2020 16:20:55 +0200 Subject: Fix #64076: imap_sort() does not return FALSE on failure If unsupported `$search_criteria` are passed to `imap_sort()`, the function returns an empty array, but there is also an error on the libc-client error stack ("Unknown search criterion: UNSUPPORTED (errflg=2)"). If, on the other hand, unsupported `$criteria` or unsupported `$flags` are passed, the function returns `false`. We solve this inconsistency by returning `false` for unsupported `$search_criteria` as well. Closes GH-6332. --- ext/imap/tests/bug64076.phpt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ext/imap/tests/bug64076.phpt (limited to 'ext/imap/tests') diff --git a/ext/imap/tests/bug64076.phpt b/ext/imap/tests/bug64076.phpt new file mode 100644 index 0000000000..ccafcfe251 --- /dev/null +++ b/ext/imap/tests/bug64076.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #64076 (imap_sort() does not return FALSE on failure) +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +Create a temporary mailbox and add 2 msgs +.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created +bool(false) +bool(true) -- cgit v1.2.1