From 21d3a9f4010fe34cbd7f27d28aad45e2b26ca3b0 Mon Sep 17 00:00:00 2001 From: djmaze Date: Wed, 9 Dec 2020 22:40:21 +0100 Subject: [PATCH] Resolve https://github.com/the-djmaze/snappymail/issues/46 Issue from https://github.com/the-djmaze/snappymail/pull/40 And my own broken $upload_max_filesize --- snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php | 7 +++---- .../0.0.0/app/libraries/RainLoop/Providers/Identities.php | 7 +++++-- 2 files changed, 8 insertions(+), 6 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 4259b4e4d..87c005413 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -1041,10 +1041,9 @@ class Actions NewThemeLink TemplatesLink LangLink PluginsLink AuthAccountHash */ - $upload_max_filesize = \ini_get('upload_max_filesize'); - $size = \strtoupper(\substr($value,-1)); - $upload_max_filesize = \intval($upload_max_filesize); - switch ($size) { + $value = \ini_get('upload_max_filesize'); + $upload_max_filesize = \intval($value); + switch (\strtoupper(\substr($value, -1))) { case 'G': $upload_max_filesize *= 1024; case 'M': $upload_max_filesize *= 1024; case 'K': $upload_max_filesize *= 1024; diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Identities.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Identities.php index 885e8be42..2a38c31a2 100755 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Identities.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Identities.php @@ -130,8 +130,11 @@ class Identities extends AbstractProvider $identities = []; foreach ($this->drivers as $driver) { // Merge and replace by key - foreach ($identitiesPerDriver[$driver->Name()] as $identity) - $identities[$identity->Id(true)] = $identity; + if (isset($identitiesPerDriver[$driver->Name()])) { + foreach ($identitiesPerDriver[$driver->Name()] as $identity) { + $identities[$identity->Id(true)] = $identity; + } + } } return \array_values($identities);