Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] feat(settings): add big file upload setup checks #49387

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/settings/lib/SetupChecks/PhpMaxFileSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public function getName(): string {
}

public function run(): SetupResult {
$upload_max_filesize = Util::computerFileSize((string)$this->iniGetWrapper->getString('upload_max_filesize'));
$post_max_size = Util::computerFileSize((string)$this->iniGetWrapper->getString('post_max_size'));
$upload_max_filesize = (string)$this->iniGetWrapper->getString('upload_max_filesize');
$post_max_size = (string)$this->iniGetWrapper->getString('post_max_size');
$max_input_time = (int)$this->iniGetWrapper->getString('max_input_time');
$max_execution_time = (int)$this->iniGetWrapper->getString('max_execution_time');

Expand All @@ -43,16 +43,16 @@ public function run(): SetupResult {
$recommendedTime = 3600;

// Check if the PHP upload limit is too low
if ($upload_max_filesize < $recommendedSize) {
if (Util::computerFileSize($upload_max_filesize) < $recommendedSize) {
$warnings[] = $this->l10n->t('The PHP upload_max_filesize is too low. A size of at least %1$s is recommended. Current value: %2$s.', [
Util::humanFileSize($recommendedSize),
Util::humanFileSize($upload_max_filesize),
$upload_max_filesize,
]);
}
if ($post_max_size < $recommendedSize) {
if (Util::computerFileSize($post_max_size) < $recommendedSize) {
$warnings[] = $this->l10n->t('The PHP post_max_size is too low. A size of at least %1$s is recommended. Current value: %2$s.', [
Util::humanFileSize($recommendedSize),
Util::humanFileSize($post_max_size),
$post_max_size,
]);
}

Expand Down
Loading