You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-06 06:42:37 +03:00
avoid: A non-numeric value encountered errors from no quota being specified
This commit is contained in:
@@ -206,7 +206,7 @@ class MailboxHandler extends PFAHandler {
|
|||||||
|
|
||||||
protected function read_from_db_postprocess($db_result) {
|
protected function read_from_db_postprocess($db_result) {
|
||||||
foreach ($db_result as $key => $row) {
|
foreach ($db_result as $key => $row) {
|
||||||
if (isset($row['quota'])) { # quota could be disabled in $struct
|
if (isset($row['quota']) && !empty($row['quota'])) { # quota could be disabled in $struct
|
||||||
$db_result[$key]['quotabytes'] = $row['quota'];
|
$db_result[$key]['quotabytes'] = $row['quota'];
|
||||||
$db_result[$key]['quota'] = divide_quota($row['quota']); # convert quota to MB
|
$db_result[$key]['quota'] = divide_quota($row['quota']); # convert quota to MB
|
||||||
} else {
|
} else {
|
||||||
@@ -219,7 +219,7 @@ class MailboxHandler extends PFAHandler {
|
|||||||
|
|
||||||
|
|
||||||
protected function beforestore() {
|
protected function beforestore() {
|
||||||
if (isset($this->values['quota']) && $this->values['quota'] != -1) {
|
if (isset($this->values['quota']) && $this->values['quota'] != -1 && is_numeric($this->values['quota'])) {
|
||||||
$multiplier = Config::read_string('quota_multiplier');
|
$multiplier = Config::read_string('quota_multiplier');
|
||||||
if ($multiplier == 0 || !is_numeric($multiplier)) { // or empty string, or null, or false...
|
if ($multiplier == 0 || !is_numeric($multiplier)) { // or empty string, or null, or false...
|
||||||
$multiplier = 1;
|
$multiplier = 1;
|
||||||
|
Reference in New Issue
Block a user