Also prevent error for #1733

This commit is contained in:
the-djmaze 2024-09-16 14:28:19 +02:00
parent e0236ea52d
commit 18452cc53c

View file

@ -749,9 +749,14 @@ class MailClient
*/ */
public function MessageList(MessageListParams $oParams) : MessageCollection public function MessageList(MessageListParams $oParams) : MessageCollection
{ {
if (0 > $oParams->iOffset || 0 > $oParams->iLimit || 999 < $oParams->iLimit) { if (0 > $oParams->iOffset || 0 > $oParams->iLimit) {
throw new \ValueError; throw new \ValueError;
} }
if (10 > $oParams->iLimit) {
$oParams->iLimit = 10;
} else if (999 < $oParams->iLimit) {
$oParams->iLimit = 50;
}
$sSearch = \trim($oParams->sSearch); $sSearch = \trim($oParams->sSearch);