From cc3486ab63ddc40440b0665e613562518bdc5044 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Wed, 8 Jun 2022 14:30:37 +0200 Subject: [PATCH] Change for #430 https://github.com/the-djmaze/snappymail/issues/430#issuecomment-1149834667 --- .../v/0.0.0/app/libraries/snappymail/repository.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/repository.php b/snappymail/v/0.0.0/app/libraries/snappymail/repository.php index 9c335c235..5a259d160 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/repository.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/repository.php @@ -237,11 +237,11 @@ abstract class Repository && (!\is_file("{$sPath}.phar") || \unlink("{$sPath}.phar")); } - public static function installPackage(string $sType, string $sId, string $sFile) : bool + public static function installPackage(string $sType, string $sId, string $sFile = '') : bool { empty($_ENV['SNAPPYMAIL_INCLUDE_AS_API']) && \RainLoop\Api::Actions()->IsAdminLoggined(); - \RainLoop\Api::Logger()->Write('Start package install: '.$sFile.' ('.$sType.')', \MailSo\Log\Enumerations\Type::INFO, 'INSTALLER'); + \RainLoop\Api::Logger()->Write('Start package install: '.$sId.' ('.$sType.')', \MailSo\Log\Enumerations\Type::INFO, 'INSTALLER'); $sRealFile = ''; @@ -255,9 +255,9 @@ abstract class Repository if ($sError) { throw new \Exception($sError); } - if (isset($aList[$sId]) && $sFile === $aList[$sId]['file']) { - $sRealFile = $sFile; - $sTmp = static::download($sFile); + if (isset($aList[$sId]) && (!$sFile || $sFile === $aList[$sId]['file'])) { + $sRealFile = $aList[$sId]['file']; + $sTmp = static::download($aList[$sId]['file']); } }