From 15b0c67ac0642715573515d297c3f27723e63e72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6ran=20Bodenschatz?= Date: Fri, 30 Jan 2015 16:52:52 +0100 Subject: [PATCH] [TASK] Change visibility of suhosin specific checks in SystemEnvironment As the PHP extension suhosin is currently not distributed in a larger manner (e. g. Debian dropped support), the checks for load status and suhosin specific parameters in Install Tool are only displayed if the extension is available and loaded. Resolves: #64647 Releases: master, 6.2 Change-Id: Iac2e984031c84f28f2d41fb6cf69ffbe1d5f6045 Reviewed-on: http://review.typo3.org/36453 Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- .../install/Classes/SystemEnvironment/Check.php | 37 ++++++++++------------ 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/typo3/sysext/install/Classes/SystemEnvironment/Check.php b/typo3/sysext/install/Classes/SystemEnvironment/Check.php index a2d26c8..0536143 100644 --- a/typo3/sysext/install/Classes/SystemEnvironment/Check.php +++ b/typo3/sysext/install/Classes/SystemEnvironment/Check.php @@ -90,15 +90,17 @@ class Check { $statusArray[] = $this->checkOpenBaseDir(); $statusArray[] = $this->checkXdebugMaxNestingLevel(); $statusArray[] = $this->checkOpenSslInstalled(); - $statusArray[] = $this->checkSuhosinLoaded(); - $statusArray[] = $this->checkSuhosinRequestMaxVars(); - $statusArray[] = $this->checkSuhosinRequestMaxVarnameLength(); - $statusArray[] = $this->checkSuhosinPostMaxNameLength(); - $statusArray[] = $this->checkSuhosinPostMaxVars(); - $statusArray[] = $this->checkSuhosinGetMaxNameLength(); - $statusArray[] = $this->checkSuhosinGetMaxValueLength(); - $statusArray[] = $this->checkSuhosinExecutorIncludeWhitelistContainsPhar(); - $statusArray[] = $this->checkSuhosinExecutorIncludeWhitelistContainsVfs(); + if ($this->isSuhosinLoadedAndActive()) { + $statusArray[] = $this->getSuhosinLoadedStatus(); + $statusArray[] = $this->checkSuhosinRequestMaxVars(); + $statusArray[] = $this->checkSuhosinRequestMaxVarnameLength(); + $statusArray[] = $this->checkSuhosinPostMaxNameLength(); + $statusArray[] = $this->checkSuhosinPostMaxVars(); + $statusArray[] = $this->checkSuhosinGetMaxNameLength(); + $statusArray[] = $this->checkSuhosinGetMaxValueLength(); + $statusArray[] = $this->checkSuhosinExecutorIncludeWhitelistContainsPhar(); + $statusArray[] = $this->checkSuhosinExecutorIncludeWhitelistContainsVfs(); + } $statusArray[] = $this->checkSomePhpOpcodeCacheIsLoaded(); $statusArray[] = $this->checkReflectionDocComment(); $statusArray[] = $this->checkSystemLocale(); @@ -575,25 +577,20 @@ class Check { } /** - * Check enabled suhosin + * Get suhosin loaded status + * Should be called only if suhosin extension is loaded * * @return Status\StatusInterface + * @throws \BadMethodCallException */ - protected function checkSuhosinLoaded() { + protected function getSuhosinLoadedStatus() { if ($this->isSuhosinLoadedAndActive()) { $status = new Status\OkStatus(); $status->setTitle('PHP suhosin extension loaded and active'); + return $status; } else { - $status = new Status\NoticeStatus(); - $status->setTitle('PHP suhosin extension not loaded or in simulation mode'); - $status->setMessage( - 'suhosin is an extension to harden the PHP environment. In general, it is' . - ' good to have it from a security point of view. While TYPO3 CMS works' . - ' fine with suhosin, it has some requirements different from the default settings' . - ' to be set if enabled.' - ); + throw new \BadMethodCallException('Should be called only if suhosin extension is loaded', 1422634778); } - return $status; } /** -- 2.1.4