diff --git a/typo3/sysext/install/Classes/SystemEnvironment/Check.php b/typo3/sysext/install/Classes/SystemEnvironment/Check.php index 9f95440633498575f232fe82dc4ced5ac86104b3..49e0fa632c5b888622841b38d7ea7e60cb9eacdf 100644 --- a/typo3/sysext/install/Classes/SystemEnvironment/Check.php +++ b/typo3/sysext/install/Classes/SystemEnvironment/Check.php @@ -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