From 7dc5eabd260be65d9614cfe6fdb67ffa00b52852 Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Sun, 25 Jun 2017 15:43:10 +0300 Subject: [PATCH] Power operator can be used. --- library/ajax/edit_user_profile.php | 2 +- library/attach_mod/includes/functions_attach.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ajax/edit_user_profile.php b/library/ajax/edit_user_profile.php index 7b963cd3c..7d9396035 100644 --- a/library/ajax/edit_user_profile.php +++ b/library/ajax/edit_user_profile.php @@ -130,7 +130,7 @@ switch ($field) { foreach (array('KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4) as $s => $m) { if (strpos($this->request['value'], $s) !== false) { - $value *= pow(1024, $m); + $value *= 1024 ** $m; break; } } diff --git a/library/attach_mod/includes/functions_attach.php b/library/attach_mod/includes/functions_attach.php index 0a4dc8fdf..c5bf4ab87 100644 --- a/library/attach_mod/includes/functions_attach.php +++ b/library/attach_mod/includes/functions_attach.php @@ -68,7 +68,7 @@ function base64_unpack($string) for ($i = 1; $i <= $length; $i++) { $pos = $length - $i; $operand = strpos($chars, $string[$pos]); - $exponent = pow($base, $i - 1); + $exponent = $base ** ($i - 1); $decValue = $operand * $exponent; $number += $decValue; }