From 41fc41984a4f6ab6b682ee7c744f23ce17081c9f Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 8 Apr 2024 17:27:40 +0200 Subject: [PATCH] Improved MessagesPerPage valid value #1540 --- snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php | 4 ++-- snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index d4bbd09bf..619f06ea4 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -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']); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php index 7347d2b9c..7853d2107 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php @@ -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) {