fixed humhub/humhub/issues/2388

This commit is contained in:
githubjeka 2017-03-22 08:14:06 +03:00
parent 693d8ee978
commit 2629b5200a

View File

@ -8,6 +8,7 @@
namespace humhub\modules\admin\controllers;
use humhub\libs\Helpers;
use Yii;
use humhub\libs\ThemeHelper;
use humhub\models\UrlOembed;
@ -185,10 +186,10 @@ class SettingController extends Controller
}
// Determine PHP Upload Max FileSize
$maxUploadSize = \humhub\libs\Helpers::GetBytesOfPHPIniValue(ini_get('upload_max_filesize'));
$maxUploadSize = Helpers::getBytesOfIniValue(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'));
if ($maxUploadSize > Helpers::getBytesOfIniValue(ini_get('post_max_size'))) {
$maxUploadSize = Helpers::getBytesOfIniValue(ini_get('post_max_size'));
$fileSizeKey = 'post_max_size';
}
@ -196,15 +197,20 @@ class SettingController extends Controller
$maxUploadSizeText = "(" . $fileSizeKey . "): " . $maxUploadSize;
// Determine currently used ImageLibary
$currentImageLibary = 'GD';
$currentImageLibrary = 'GD';
if (Yii::$app->getModule('file')->settings->get('imageMagickPath')) {
$currentImageLibary = 'ImageMagick';
$currentImageLibrary = 'ImageMagick';
}
return $this->render('file', ['model' => $form,
'maxUploadSize' => $maxUploadSize,
'maxUploadSizeText' => $maxUploadSizeText,
'currentImageLibary' => $currentImageLibary]);
return $this->render(
'file',
[
'model' => $form,
'maxUploadSize' => $maxUploadSize,
'maxUploadSizeText' => $maxUploadSizeText,
'currentImageLibrary' => $currentImageLibrary,
]
);
}
/**