Improved MessagesPerPage valid value #1540

This commit is contained in:
the-djmaze 2024-04-08 17:27:40 +02:00
parent bcc2c7b9ca
commit 41fc41984a
2 changed files with 3 additions and 3 deletions

View file

@ -583,7 +583,7 @@ class Actions
'MaxBlockquotesLevel' => 0,
'simpleAttachmentsList' => false,
'listGrouped' => $oConfig->Get('defaults', 'mail_list_grouped', false),
'MessagesPerPage' => \max(5, (int) $oConfig->Get('webmail', 'messages_per_page', 25)),
'MessagesPerPage' => \max(10, \intval($oConfig->Get('webmail', 'messages_per_page', 25)) ?: 25),
'messageNewWindow' => false,
'messageReadAuto' => true, // (bool) $oConfig->Get('webmail', 'message_read_auto', true),
'MessageReadDelay' => (int) $oConfig->Get('webmail', 'message_read_delay', 5),
@ -678,7 +678,7 @@ class Actions
$aResult['simpleAttachmentsList'] = (bool)$oSettings->GetConf('simpleAttachmentsList', $aResult['simpleAttachmentsList']);
$aResult['listGrouped'] = (bool)$oSettings->GetConf('listGrouped', $aResult['listGrouped']);
$aResult['ContactsAutosave'] = (bool)$oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']);
$aResult['MessagesPerPage'] = \max(5, (int)$oSettings->GetConf('MessagesPerPage', $aResult['MessagesPerPage']));
$aResult['MessagesPerPage'] = \max(10, \intval($oSettings->GetConf('MessagesPerPage', $aResult['MessagesPerPage']) ?: $aResult['MessagesPerPage']));
$aResult['messageNewWindow'] = (int)$oSettings->GetConf('messageNewWindow', $aResult['messageNewWindow']);
$aResult['messageReadAuto'] = (int)$oSettings->GetConf('messageReadAuto', $aResult['messageReadAuto']);
$aResult['MessageReadDelay'] = (int)$oSettings->GetConf('MessageReadDelay', $aResult['MessageReadDelay']);

View file

@ -157,7 +157,7 @@ trait User
}
$this->setSettingsFromParams($oSettings, 'MessagesPerPage', 'int', function ($iValue) {
return \min(50, \max(10, $iValue));
return \min(100, \max(10, $iValue));
});
$this->setSettingsFromParams($oSettings, 'Layout', 'int', function ($iValue) {