Resolve #1640 workaround PHP issue

This commit is contained in:
the-djmaze 2024-06-23 12:49:05 +02:00
parent 8d11ad43da
commit b2b3dac35b

View file

@ -119,7 +119,11 @@ trait Status
} }
if (\property_exists(__TRAIT__, $name)) { if (\property_exists(__TRAIT__, $name)) {
if ('MAILBOXID' === $name) { if ('MAILBOXID' === $name) {
$this->MAILBOXID = \base64_encode(\is_array($value) ? $value[0] : $value); // https://github.com/the-djmaze/snappymail/issues/1640
$value = \is_array($value) ? \reset($value) : $value;
if (\is_string($value)) {
$this->MAILBOXID = \base64_encode($value);
}
} else { } else {
$this->$name = (int) $value; $this->$name = (int) $value;
} }