[BUGFIX] Misinterpretaion of memory_limit setting in install tool
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_div.php
index 0661099..dc15efc 100644 (file)
@@ -3244,18 +3244,13 @@ final class t3lib_div {
         * @return integer The bytes value (e.g. 102400)
         */
        public static function getBytesFromSizeMeasurement($measurement) {
+               $bytes = doubleval($measurement);
                if (stripos($measurement, 'G')) {
-                       $bytes = doubleval($measurement) * 1024 * 1024 * 1024;
-               } else {
-                       if (stripos($measurement, 'M')) {
-                               $bytes = doubleval($measurement) * 1024 * 1024;
-                       } else {
-                               if (stripos($measurement, 'K')) {
-                                       $bytes = doubleval($measurement) * 1024;
-                               } else {
-                                       $bytes = doubleval($measurement);
-                               }
-                       }
+                       $bytes *= 1024 * 1024 * 1024;
+               } elseif (stripos($measurement, 'M')) {
+                       $bytes *= 1024 * 1024;
+               } elseif (stripos($measurement, 'K')) {
+                       $bytes *= 1024;
                }
                return $bytes;
        }