Avoid typecasting to float when not needed
Fixes #12303 Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
de1e473a9d
commit
b27020f108
@ -12,6 +12,7 @@ phpMyAdmin - ChangeLog
|
||||
- issue #12414 Fixed rendering of Original theme
|
||||
- issue #12413 Fixed deleting users in non English locales
|
||||
- issue #12416 Fixed replication status output in Databases listing
|
||||
- issue #12303 Avoid typecasting to float when not needed
|
||||
|
||||
4.6.3 (2016-06-23)
|
||||
- issue #12249 Fixed cookie path on Windows
|
||||
|
||||
@ -85,7 +85,7 @@ class Util
|
||||
$pow = gmp_strval(gmp_pow($base, $exp));
|
||||
break;
|
||||
case 'pow' :
|
||||
$base = (float) $base;
|
||||
$base = $base;
|
||||
$exp = (int) $exp;
|
||||
$pow = pow($base, $exp);
|
||||
break;
|
||||
@ -1461,8 +1461,7 @@ class Util
|
||||
$unit = $byteUnits[0];
|
||||
|
||||
for ($d = 6, $ex = 15; $d >= 1; $d--, $ex-=3) {
|
||||
// cast to float to avoid overflow
|
||||
$unitSize = (float) $li * self::pow(10, $ex);
|
||||
$unitSize = $li * self::pow(10, $ex);
|
||||
if (isset($byteUnits[$d]) && $value >= $unitSize) {
|
||||
// use 1024.0 to avoid integer overflow on 64-bit machines
|
||||
$value = round($value / (self::pow(1024, $d) / $dh)) /$dh;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user