[TASK] Change visibility of suhosin specific checks in SystemEnvironment 44/36444/6
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:03:57 +0000 (18:03 +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/36444
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Classes/SystemEnvironment/Check.php

index 4cb0187..1d6897e 100644 (file)
@@ -89,15 +89,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();
@@ -547,25 +549,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;
        }
 
        /**