Loading core/lib/Drupal/Component/Utility/Bytes.php +2 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ public static function toInt($size) { return round($size * pow(self::KILOBYTE, stripos('bkmgtpezy', $unit[0]))); } else { return round($size); // Ensure size is a proper number type. return round((float) $size); } } Loading core/tests/Drupal/Tests/Component/Utility/BytesTest.php +3 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,9 @@ public function providerTestToInt() { ['76MRandomStringThatShouldBeIgnoredByParseSize.', 79691776], // 76.24 GB (with typo). ['76.24 Giggabyte', 81862076662], ['1.5', 2], ['2.4', 2], ['', 0], ]; } Loading Loading
core/lib/Drupal/Component/Utility/Bytes.php +2 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ public static function toInt($size) { return round($size * pow(self::KILOBYTE, stripos('bkmgtpezy', $unit[0]))); } else { return round($size); // Ensure size is a proper number type. return round((float) $size); } } Loading
core/tests/Drupal/Tests/Component/Utility/BytesTest.php +3 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,9 @@ public function providerTestToInt() { ['76MRandomStringThatShouldBeIgnoredByParseSize.', 79691776], // 76.24 GB (with typo). ['76.24 Giggabyte', 81862076662], ['1.5', 2], ['2.4', 2], ['', 0], ]; } Loading