Fixed memory limit calculation
authorMarcel Werk <burntime@woltlab.com>
Thu, 22 Feb 2018 13:01:57 +0000 (14:01 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 22 Feb 2018 13:01:57 +0000 (14:01 +0100)
wcfsetup/install/files/lib/util/FileUtil.class.php

index 00095f531fe862e3ebeb7c950b8869e8e56b33be..53ff7acbbd94f567c1d12f5abb8b27afbc42d685 100644 (file)
@@ -608,8 +608,8 @@ final class FileUtil {
                        }
                        
                        // PHP supports 'K', 'M' and 'G' shorthand notation
-                       if (preg_match('~^(\d+)([KMG])$~', $memoryLimit, $matches)) {
-                               switch ($matches[2]) {
+                       if (preg_match('~^(\d+)\s*([KMG])$~i', $memoryLimit, $matches)) {
+                               switch (strtoupper($matches[2])) {
                                        case 'K':
                                                self::$memoryLimit = $matches[1] * 1024;
                                        break;