From e8c2c1bbc7029a2cba7ba239dd807c3015f916c6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 24 Jul 2020 16:36:42 +0200 Subject: [PATCH] fix broken token/syntax, if no metadata yet --- api/src/Mail/Imap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Mail/Imap.php b/api/src/Mail/Imap.php index 73b8f5643f..e54f5da44c 100644 --- a/api/src/Mail/Imap.php +++ b/api/src/Mail/Imap.php @@ -1455,8 +1455,8 @@ class Imap extends Horde_Imap_Client_Socket implements Imap\PushIface return false; } try { - $metadata = explode(self::METADATA_SEPARATOR, - $this->getMetadata(self::METADATA_MAILBOX, [self::METADATA_NAME])[self::METADATA_MAILBOX][self::METADATA_NAME]) ?: []; + $metadata = ($m = $this->getMetadata(self::METADATA_MAILBOX, [self::METADATA_NAME])[self::METADATA_MAILBOX][self::METADATA_NAME]) ? + explode(self::METADATA_SEPARATOR, $m) : []; $my_token = $this->pushToken($account_id); $my_token_preg = '/^'.$this->pushToken($account_id, '[^@]+').'$/'; foreach($metadata as $key => $token)