mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 00:04:05 +02:00
parent
717669ed4a
commit
c9c59b3f03
@ -33,17 +33,19 @@ class MemoryLimit
|
||||
public static function parsePhpIniByteString($string)
|
||||
{
|
||||
$val = trim($string);
|
||||
$last = strtoupper(substr($val, -1, 1));
|
||||
|
||||
switch ($last) {
|
||||
case 'G':
|
||||
$val *= 1024;
|
||||
if (preg_match('/^(\d+)([KMG])$/', $val, $m)) {
|
||||
$val = $m[1];
|
||||
switch ($m[2]) {
|
||||
case 'G':
|
||||
$val *= 1024;
|
||||
// Intentional fall-through
|
||||
case 'M':
|
||||
$val *= 1024;
|
||||
case 'M':
|
||||
$val *= 1024;
|
||||
// Intentional fall-through
|
||||
case 'K':
|
||||
$val *= 1024;
|
||||
case 'K':
|
||||
$val *= 1024;
|
||||
}
|
||||
}
|
||||
|
||||
return intval($val);
|
||||
|
Loading…
x
Reference in New Issue
Block a user