Skip to content

Commit

Permalink
Fetch all msg headers also for images to always get Content-Location
Browse files Browse the repository at this point in the history
Previously all headers were only fetched for message/rfc822, or
if the Content-Type's "name" parameter was set, or if a Content-ID was
set.
The RFC doesn't require neither the "name" parameter nor a Content-ID
for using Content-Location, though, so we shouldn't depend on those.

Instead now all headers are also fetched if the main part of the
Content-Type is "image", to catch more cases.
  • Loading branch information
pabzm committed Aug 15, 2024
1 parent 79f332b commit d9fe09b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions program/lib/Roundcube/rcube_imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2230,9 +2230,9 @@ protected function structure_part($part, $count = 0, $parent = '', $mime_headers
}
}

// fetch message headers if message/rfc822 or named part (could contain Content-Location header)
// fetch message headers if message/rfc822 or image or named part (could contain Content-Location header)
if (
$struct->ctype_primary == 'message'
$struct->ctype_primary == 'message' || $struct->ctype_primary == 'image'
|| (!empty($struct->ctype_parameters['name']) && !empty($struct->content_id))
) {
if (empty($mime_headers)) {
Expand Down

0 comments on commit d9fe09b

Please sign in to comment.