Skip to content

Commit

Permalink
Return early if server doesn't support quota
Browse files Browse the repository at this point in the history
  • Loading branch information
pabzm committed Jan 25, 2024
1 parent 198b999 commit b0dc40f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions program/include/rcmail_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ public static function quota_set_env()
// need to do that manually (the return value is `false` if the server
// doesn't support it).
$quota = $rcmail->storage->get_quota();
// Return early if the server doesn't support quotas anyway.
if ($quota === false) {
$rcmail->output->set_env('quota', false);
}
$zero_as_unlimited = (bool) $rcmail->config->get('quota_zero_as_unlimited');
// Show the quota display only if it's not unlimited.
$show_quota = is_array($quota) && !($quota['total'] === 0 && $zero_as_unlimited);
Expand Down

0 comments on commit b0dc40f

Please sign in to comment.