Remove Suhosin compatibility layer in PackageInstallationDispatcher
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 15 Jun 2021 15:06:28 +0000 (17:06 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 15 Jun 2021 15:06:28 +0000 (17:06 +0200)
Suhosin is no more. The last / final release was in 2015.

wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php

index 6e628956fa7bc928be9a00c5ba3f3f10122c22b5..a7327023843de705c78c9b39812cfabc7812776c 100644 (file)
@@ -1306,7 +1306,7 @@ class PackageInstallationDispatcher
             foreach ($requirements['functions'] as $function) {
                 $function = \mb_strtolower($function);
 
-                $passed = self::functionExists($function);
+                $passed = \function_exists($function);
                 if (!$passed) {
                     $errors['function'][] = [
                         'function' => $function,
@@ -1341,28 +1341,10 @@ class PackageInstallationDispatcher
     }
 
     /**
-     * Validates if an function exists and is not blacklisted by suhosin extension.
-     *
-     * @param string $function
-     * @return  bool
-     * @see     http://de.php.net/manual/en/function.function-exists.php#77980
+     * @deprecated 5.5 - This used to check against 'suhosin.executor.func.blacklist' but now simply aliases function_exists(). Use function_exists() directly.
      */
     protected static function functionExists($function)
     {
-        if (\extension_loaded('suhosin')) {
-            $blacklist = @\ini_get('suhosin.executor.func.blacklist');
-            if (!empty($blacklist)) {
-                $blacklist = \explode(',', $blacklist);
-                foreach ($blacklist as $disabledFunction) {
-                    $disabledFunction = \mb_strtolower(StringUtil::trim($disabledFunction));
-
-                    if ($function == $disabledFunction) {
-                        return false;
-                    }
-                }
-            }
-        }
-
         return \function_exists($function);
     }