From b27020f10882cf74317b26c93034a7312e4656a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 29 Jul 2016 14:03:13 +0200 Subject: [PATCH] Avoid typecasting to float when not needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #12303 Signed-off-by: Michal Čihař --- ChangeLog | 1 + libraries/Util.php | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7bd07d6347..41c6e80e71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/libraries/Util.php b/libraries/Util.php index 8606f4de91..9007e9531f 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -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;