From 56ac532d55b06cd75e3e153dbe3b629305e08a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=83=A1?= <3203164629@qq.com> Date: Tue, 15 Oct 2024 03:13:07 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 小胡 <3203164629@qq.com> --- core/function/function_core.php | 24 +++++++++++------------- core/function/function_message.php | 2 -- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/core/function/function_core.php b/core/function/function_core.php index 9f0c50b..dfe6b33 100644 --- a/core/function/function_core.php +++ b/core/function/function_core.php @@ -1642,19 +1642,17 @@ function getexpiration() return mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']) + 86400; } -function return_bytes($val) -{ - $val = trim($val); - $last = strtolower($val{strlen($val) - 1}); - switch ($last) { - case 'g': - $val *= 1024; - case 'm': - $val *= 1024; - case 'k': - $val *= 1024; - } - return $val; +function return_bytes($val) { + $last = strtolower($val[strlen($val)-1]); + if (!is_numeric($val)) { + $val = substr(trim($val), 0, -1); + } + switch($last) { + case 'g': $val *= 1024; + case 'm': $val *= 1024; + case 'k': $val *= 1024; + } + return $val; } diff --git a/core/function/function_message.php b/core/function/function_message.php index 853ed80..fef9f68 100644 --- a/core/function/function_message.php +++ b/core/function/function_message.php @@ -51,8 +51,6 @@ function dshowmessage($message, $url_forward = '', $values = array(), $extrapara if(!empty($_G['inajax'])) { $handlekey = $_GET['handlekey'] = !empty($_GET['handlekey']) ? dhtmlspecialchars($_GET['handlekey']) : ''; $param['handle'] = true; - } - if(!empty($_G['inajax'])) { $param['msgtype'] = empty($_GET['ajaxmenu']) && (empty($_POST) || !empty($_GET['nopost'])) ? 2 : 3; } if($url_forward) {