We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c1224a commit 997fea3Copy full SHA for 997fea3
server/php/UploadHandler.php
@@ -375,15 +375,22 @@ protected function get_error_message($error) {
375
}
376
377
public function get_config_bytes($val) {
378
- $val = trim($val);
379
- $last = strtolower($val[strlen($val)-1]);
380
- $val = (int)$val;
381
- switch ($last) {
+ $str = trim($val);
+ $last = strtolower($str[strlen($str)-1]);
+ if(is_numeric($last)) {
+ $val = (int) $str;
382
+ } else {
383
+ $val = (int) substr($str, 0, -1);
384
+ }
385
+ switch($last) {
386
case 'g':
387
+ case 'G':
388
$val *= 1024;
389
case 'm':
390
+ case 'M':
391
392
case 'k':
393
+ case 'K':
394
395
396
return $this->fix_integer_overflow($val);
0 commit comments