[TASK] Change visibility of suhosin specific checks in SystemEnvironment 53/36453/2
authorGöran Bodenschatz <coding@46halbe.de>
Fri, 30 Jan 2015 15:52:52 +0000 (16:52 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 30 Jan 2015 17:04:38 +0000 (18:04 +0100)
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 <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Classes/SystemEnvironment/Check.php

index a2d26c8..0536143 100644 (file)
@@ -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;
        }
 
        /**