mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
dont assume 'quota' will be in the values, just like block before wasn't assuming (#823)
Co-authored-by: Nuno Tavares <n.tavares@portavita.eu>
This commit is contained in:
parent
0876c368e4
commit
4ae78cd172
@ -239,17 +239,17 @@ class MailboxHandler extends PFAHandler
|
|||||||
|
|
||||||
protected function preSave(): bool
|
protected function preSave(): bool
|
||||||
{
|
{
|
||||||
if (isset($this->values['quota']) && $this->values['quota'] != -1 && is_numeric($this->values['quota'])) {
|
if (isset($this->values['quota'])) {
|
||||||
$multiplier = Config::read_string('quota_multiplier');
|
if ($this->values['quota'] != -1 && is_numeric($this->values['quota'])) {
|
||||||
if ($multiplier == 0 || !is_numeric($multiplier)) { // or empty string, or null, or false...
|
$multiplier = Config::read_string('quota_multiplier');
|
||||||
$multiplier = 1;
|
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;
|
||||||
}
|
}
|
||||||
$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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ah = new AliasHandler($this->new, $this->admin_username);
|
$ah = new AliasHandler($this->new, $this->admin_username);
|
||||||
|
Loading…
Reference in New Issue
Block a user