Commit 91a7c79b authored by Frank Nägler's avatar Frank Nägler Committed by Christian Kuhn
Browse files

[TASK] Add check for max_input_vars setting in install tool

This patch add a check for max_input_vars setting.

Resolves: #67978
Related: #64615
Releases: master
Change-Id: Ib8b376184582733c85979a164da6580741472485
Reviewed-on: http://review.typo3.org/40987


Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarFrederic Gaus <frederic.gaus@flagbit.de>
Tested-by: default avatarFrederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 98f30868
......@@ -101,6 +101,7 @@ class Check {
$statusArray[] = $this->checkSuhosinExecutorIncludeWhitelistContainsPhar();
$statusArray[] = $this->checkSuhosinExecutorIncludeWhitelistContainsVfs();
}
$statusArray[] = $this->checkMaxInputVars();
$statusArray[] = $this->checkSomePhpOpcodeCacheIsLoaded();
$statusArray[] = $this->checkReflectionDocComment();
$statusArray[] = $this->checkSystemLocale();
......@@ -575,6 +576,43 @@ class Check {
return $status;
}
/**
* Get max_input_vars status
*
* @return Status\StatusInterface
*/
protected function checkMaxInputVars() {
$recommendedMaxInputVars = 1500;
$minimumMaxInputVars = 1000;
$currentMaxInputVars = ini_get('max_input_vars');
if ($currentMaxInputVars < $minimumMaxInputVars) {
$status = new Status\ErrorStatus();
$status->setTitle('PHP max_input_vars too low');
$status->setMessage(
'max_input_vars=' . $currentMaxInputVars . LF .
'This setting can lead to lost information if submitting forms with lots of data in TYPO3 CMS' .
' (as the install tool does). It is highly recommended to raise this' .
' to at least ' . $recommendedMaxInputVars . ':' . LF .
'max_input_vars=' . $recommendedMaxInputVars
);
} elseif ($currentMaxInputVars < $recommendedMaxInputVars) {
$status = new Status\WarningStatus();
$status->setTitle('PHP max_input_vars very low');
$status->setMessage(
'max_input_vars=' . $currentMaxInputVars . LF .
'This setting can lead to lost information if submitting forms with lots of data in TYPO3 CMS' .
' (as the install tool does). It is highly recommended to raise this' .
' to at least ' . $recommendedMaxInputVars . ':' . LF .
'max_input_vars=' . $recommendedMaxInputVars
);
} else {
$status = new Status\OkStatus();
$status->setTitle('PHP max_input_vars ok');
}
return $status;
}
/**
* Get suhosin loaded status
* Should be called only if suhosin extension is loaded
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment