Skip to content

Conversation

@cmb69
Copy link
Member

@cmb69 cmb69 commented Oct 13, 2020

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.


I'm unsure about the "details" here. Silently failing is unusual, but seems to be pretty common for ext/imap. Also I'm not sure which branch to target. While I consider the behavior a bug, returning an empty array is not terribly wrong, so maybe 8.0/master would be more appropriate.

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.
Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with this as-is, also for 7.3. If imap reports and error, we should treat it as an error...

@cmb69
Copy link
Member Author

cmb69 commented Oct 13, 2020

Makes sense. Thanks!

@php-pulls php-pulls closed this in db8bf0a Oct 13, 2020
@cmb69 cmb69 deleted the cmb/64076 branch October 13, 2020 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants