diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index 9c20ad8dfe..32f8c1f97d 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -4,6 +4,8 @@ HumHub Change Log 1.2.0-beta.3 under developement -------------------------------- +- Fix: Added unknown upload error if server cancels upload (e.g in case of a post_max_size violation issue) +- Enh: Added warning if php max upload/post is less than the humhub setting. - Enh: Added mp4/ogg blueimp support in post gallery - Enh: Added global (default) notification space settings - Enh: #2359 Use Jplayer playlist feature for post mp3 diff --git a/protected/humhub/modules/admin/controllers/SettingController.php b/protected/humhub/modules/admin/controllers/SettingController.php index 49663137da..9903d6cec5 100644 --- a/protected/humhub/modules/admin/controllers/SettingController.php +++ b/protected/humhub/modules/admin/controllers/SettingController.php @@ -192,17 +192,25 @@ class SettingController extends Controller // Determine PHP Upload Max FileSize $maxUploadSize = \humhub\libs\Helpers::GetBytesOfPHPIniValue(ini_get('upload_max_filesize')); + $fileSizeKey = 'upload_max_filesize'; if ($maxUploadSize > \humhub\libs\Helpers::GetBytesOfPHPIniValue(ini_get('post_max_size'))) { $maxUploadSize = \humhub\libs\Helpers::GetBytesOfPHPIniValue(ini_get('post_max_size')); + $fileSizeKey = 'post_max_size'; } + $maxUploadSize = floor($maxUploadSize / 1024 / 1024); - + $maxUploadSizeText = "(".$fileSizeKey."): ".$maxUploadSize; + // Determine currently used ImageLibary $currentImageLibary = 'GD'; - if (Yii::$app->getModule('file')->settings->get('imageMagickPath')) + if (Yii::$app->getModule('file')->settings->get('imageMagickPath')) { $currentImageLibary = 'ImageMagick'; + } - return $this->render('file', array('model' => $form, 'maxUploadSize' => $maxUploadSize, 'currentImageLibary' => $currentImageLibary)); + return $this->render('file', ['model' => $form, + 'maxUploadSize' => $maxUploadSize, + 'maxUploadSizeText' => $maxUploadSizeText, + 'currentImageLibary' => $currentImageLibary]); } /** diff --git a/protected/humhub/modules/admin/views/setting/file.php b/protected/humhub/modules/admin/views/setting/file.php index 6b8dd3ec21..88c879c5f7 100644 --- a/protected/humhub/modules/admin/views/setting/file.php +++ b/protected/humhub/modules/admin/views/setting/file.php @@ -22,7 +22,9 @@ use humhub\models\Setting;
$maxUploadSize)); ?>
+maxFileSize > $maxUploadSize) ? 'style="color:'.$this->theme->variable('danger').' !important"' : ''?>> + = Yii::t('AdminModule.views_setting_file', 'PHP reported a maximum of {maxUploadSize} MB', array('{maxUploadSize}' => $maxUploadSizeText)); ?> +