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