summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/helper.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 144ccbfe228..981447c213b 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -394,6 +394,9 @@ class OC_Helper {
*/
public static function computerFileSize($str) {
$str = strtolower($str);
+ if (is_numeric($str)) {
+ return $str;
+ }
$bytes_array = array(
'b' => 1,
@@ -413,6 +416,8 @@ class OC_Helper {
if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) {
$bytes *= $bytes_array[$matches[1]];
+ } else {
+ return false;
}
$bytes = round($bytes);