mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 06:27:52 +00:00
fix: cut bytestring into numeric part
This commit is contained in:
@@ -116,20 +116,19 @@ function setMinMemoryLimit($memDestSize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getBytes($val) {
|
function getBytes($val) {
|
||||||
if (is_numeric($val)) {
|
|
||||||
$val = trim($val);
|
$val = trim($val);
|
||||||
|
$numeric = substr($val, 0, strlen($val) -1);
|
||||||
$last = strtolower($val[strlen($val) - 1]);
|
$last = strtolower($val[strlen($val) - 1]);
|
||||||
switch($last) {
|
switch($last) {
|
||||||
// The 'G' modifier is available since PHP 5.1.0
|
// The 'G' modifier is available since PHP 5.1.0
|
||||||
case 'g':
|
case 'g':
|
||||||
$val *= 1024;
|
$numeric *= 1024;
|
||||||
case 'm':
|
case 'm':
|
||||||
$val *= 1024;
|
$numeric *= 1024;
|
||||||
case 'k':
|
case 'k':
|
||||||
$val *= 1024;
|
$numeric *= 1024;
|
||||||
}
|
|
||||||
return $val;
|
|
||||||
}
|
}
|
||||||
|
return $numeric;
|
||||||
}
|
}
|
||||||
|
|
||||||
function encrypt($str, $key){
|
function encrypt($str, $key){
|
||||||
|
|||||||
Reference in New Issue
Block a user