aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/text.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php
index f1043909d..f8bc4b6b0 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1826,7 +1826,9 @@ function lang_selector() {
function engr_units_to_bytes ($size_str) {
- switch (substr ($size_str, -1)) {
+ if(! $size_str)
+ return $size_str;
+ switch (substr(trim($size_str), -1)) {
case 'M': case 'm': return (int)$size_str * 1048576;
case 'K': case 'k': return (int)$size_str * 1024;
case 'G': case 'g': return (int)$size_str * 1073741824;