Skip to content

Commit

Permalink
Merge pull request #8936 from nextcloud/backport/8930/stable3.4
Browse files Browse the repository at this point in the history
[stable3.4] fix(sync): return if headers couldn't be parsed
  • Loading branch information
GretaD authored Oct 11, 2023
2 parents 29b2ce4 + b009352 commit 20646e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/IMAP/ImapMessageFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
use Horde_Imap_Client_Fetch_Query;
use Horde_Imap_Client_Ids;
use Horde_ListHeaders;
use Horde_ListHeaders_Base;
use Horde_Mime_Exception;
use Horde_Mime_Headers;
use Horde_Mime_Part;
Expand Down Expand Up @@ -523,8 +522,11 @@ private function parseHeaders(Horde_Imap_Client_Data_Fetch $fetch): void {
$listUnsubscribeHeader = $parsedHeaders->getHeader('list-unsubscribe');
if ($listUnsubscribeHeader !== null) {
$listHeaders = new Horde_ListHeaders();
/** @var Horde_ListHeaders_Base[] $headers */
$headers = $listHeaders->parse($listUnsubscribeHeader->name, $listUnsubscribeHeader->value_single);
if (!$headers) {
// Unable to parse headers
return;
}
foreach ($headers as $header) {
if (str_starts_with($header->url, 'http')) {
$this->unsubscribeUrl = $header->url;
Expand Down

0 comments on commit 20646e8

Please sign in to comment.