Signed-off-by: 小胡 <3203164629@qq.com>
This commit is contained in:
小胡
2024-10-15 03:13:07 +00:00
committed by Gitee
Unverified
parent 6e781f4693
commit 56ac532d55
2 changed files with 11 additions and 15 deletions

View File

@@ -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;
}

View File

@@ -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) {