Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 41fc419

Browse files
author
the-djmaze
committed
Improved MessagesPerPage valid value #1540
1 parent bcc2c7b commit 41fc419

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ public function AppData(bool $bAdmin): array
583583
'MaxBlockquotesLevel' => 0,
584584
'simpleAttachmentsList' => false,
585585
'listGrouped' => $oConfig->Get('defaults', 'mail_list_grouped', false),
586-
'MessagesPerPage' => \max(5, (int) $oConfig->Get('webmail', 'messages_per_page', 25)),
586+
'MessagesPerPage' => \max(10, \intval($oConfig->Get('webmail', 'messages_per_page', 25)) ?: 25),
587587
'messageNewWindow' => false,
588588
'messageReadAuto' => true, // (bool) $oConfig->Get('webmail', 'message_read_auto', true),
589589
'MessageReadDelay' => (int) $oConfig->Get('webmail', 'message_read_delay', 5),
@@ -678,7 +678,7 @@ public function AppData(bool $bAdmin): array
678678
$aResult['simpleAttachmentsList'] = (bool)$oSettings->GetConf('simpleAttachmentsList', $aResult['simpleAttachmentsList']);
679679
$aResult['listGrouped'] = (bool)$oSettings->GetConf('listGrouped', $aResult['listGrouped']);
680680
$aResult['ContactsAutosave'] = (bool)$oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']);
681-
$aResult['MessagesPerPage'] = \max(5, (int)$oSettings->GetConf('MessagesPerPage', $aResult['MessagesPerPage']));
681+
$aResult['MessagesPerPage'] = \max(10, \intval($oSettings->GetConf('MessagesPerPage', $aResult['MessagesPerPage']) ?: $aResult['MessagesPerPage']));
682682
$aResult['messageNewWindow'] = (int)$oSettings->GetConf('messageNewWindow', $aResult['messageNewWindow']);
683683
$aResult['messageReadAuto'] = (int)$oSettings->GetConf('messageReadAuto', $aResult['messageReadAuto']);
684684
$aResult['MessageReadDelay'] = (int)$oSettings->GetConf('MessageReadDelay', $aResult['MessageReadDelay']);

snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function DoSettingsUpdate() : array
157157
}
158158

159159
$this->setSettingsFromParams($oSettings, 'MessagesPerPage', 'int', function ($iValue) {
160-
return \min(50, \max(10, $iValue));
160+
return \min(100, \max(10, $iValue));
161161
});
162162

163163
$this->setSettingsFromParams($oSettings, 'Layout', 'int', function ($iValue) {

0 commit comments

Comments
 (0)