diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/account.php | 3 | ||||
-rw-r--r-- | include/photos.php | 2 | ||||
-rw-r--r-- | include/text.php | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/include/account.php b/include/account.php index c64197b49..5998609d4 100644 --- a/include/account.php +++ b/include/account.php @@ -591,6 +591,7 @@ function service_class_allows($uid, $property, $usage = false) { if($limit === false) return true; // No service class set => everything is allowed + $limit = engr_units_to_bytes($limit); if($usage === false) { // We use negative values for not allowed properties in a subscriber plan return ((x($limit)) ? (bool) $limit : true); @@ -627,6 +628,8 @@ function account_service_class_allows($aid, $property, $usage = false) { if($limit === false) return true; // No service class is set => everything is allowed + $limit = engr_units_to_bytes($limit); + if($usage === false) { // We use negative values for not allowed properties in a subscriber plan return ((x($limit)) ? (bool) $limit : true); diff --git a/include/photos.php b/include/photos.php index d088d455a..73a29d8eb 100644 --- a/include/photos.php +++ b/include/photos.php @@ -131,7 +131,7 @@ function photo_upload($channel, $observer, $args) { intval($account_id) ); - $limit = service_class_fetch($channel_id,'photo_upload_limit'); + $limit = engr_units_to_bytes(service_class_fetch($channel_id,'photo_upload_limit')); if (($r) && ($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) { $ret['message'] = upgrade_message(); diff --git a/include/text.php b/include/text.php index 926e2eed6..f1043909d 100644 --- a/include/text.php +++ b/include/text.php @@ -1825,7 +1825,7 @@ function lang_selector() { } -function return_bytes ($size_str) { +function engr_units_to_bytes ($size_str) { switch (substr ($size_str, -1)) { case 'M': case 'm': return (int)$size_str * 1048576; case 'K': case 'k': return (int)$size_str * 1024; |