summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-05-15 18:07:13 +0200
committerVincent Petry <pvince81@owncloud.com>2015-05-15 18:07:13 +0200
commit246000f799f431066e3647137c4a710d230b4fbe (patch)
tree79848043d11283365916ff0f52d54562ba1e72c5 /lib
parent4c60b13d1e58d009dab40cd74a2aa0b6520acc81 (diff)
parent4659927d7a1f2fdb72fc8ea3d34e5f9cd5e7f497 (diff)
downloadnextcloud-server-246000f799f431066e3647137c4a710d230b4fbe.tar.gz
nextcloud-server-246000f799f431066e3647137c4a710d230b4fbe.zip
Merge pull request #16176 from owncloud/fix-provisioning-api-set-quota
Validate the quota value to be a correct value
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);