From d3dfe6382b4c6ee6e5fbfed566cb875df66572aa Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 22 Apr 2024 21:00:12 +0100 Subject: [PATCH] fix syntax error added in 4ae78cd172c9efcaa8199d9366bfe2103bcc71c1 and #823 --- model/MailboxHandler.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index b78cb339..e552a50a 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -239,19 +239,19 @@ class MailboxHandler extends PFAHandler protected function preSave(): bool { - if (isset($this->values['quota'])) { - if ($this->values['quota'] != -1 && is_numeric($this->values['quota'])) { - $multiplier = Config::read_string('quota_multiplier'); - if ($multiplier == 0 || !is_numeric($multiplier)) { // or empty string, or null, or false... - $multiplier = 1; - } - $this->values['quota'] = $this->values['quota'] * $multiplier; # convert quota from MB to bytes - // Avoid trying to store '' in an integer field - if ($this->values['quota'] === '') { - $this->values['quota'] = 0; + if (isset($this->values['quota']) && $this->values['quota'] != -1 && is_numeric($this->values['quota'])) { + $multiplier = Config::read_string('quota_multiplier'); + if ($multiplier == 0 || !is_numeric($multiplier)) { // or empty string, or null, or false... + $multiplier = 1; } - } + $this->values['quota'] = $this->values['quota'] * $multiplier; # convert quota from MB to bytes + + } + // Avoid trying to store '' in an integer field + if (isset($this->values['quota']) && $this->values['quota'] === '') { + $this->values['quota'] = 0; + } $ah = new AliasHandler($this->new, $this->admin_username); $ah->calledBy('MailboxHandler');