* Check if "inline" msg part is actually referred to
If there's no reference to it in a sibling HTML part then we handle it
as a classic attachment (which is shown as downloadable).
* Fetch all msg headers also for images to always get Content-Location
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.
* Parse HTML for references only on demand
* Typos and comment formatting
* Don't skip test anymore
We want it tested!
* More MR tests with images
* Remove early special handling for "inline" images
We decide later, which attachment is considered "inline" and which
isn't.
* Remove early resolving of references in TNEF parts
* Testing message rendering of TNEF emails
* Don't use image disposition, it's unreliable
* Split adding raw parts and attachments
* Fix renaming variable
* Rename file to make its test be run
* Remove outdated script
* Annotate test cases with GitHub issue numbers
* Fix test case class name
* remove comment
* Test inline image message rendering
* Rename test file to reflect cases better
* Reduce image used in test email
It doesn't change much, but there's also no sense in decoding big images
that we don't use.
* Remove unused variable initialisation
* Fix displaying message/rfc822 parts
The previous code contained a simple error that assigned the body part
to the $headers variable (which then couldn't be parsed and got
discarded).
* Test rendering of attached message/rfc822 parts
Because of this, the insert_or_update() method never uses the "INSERT INTO ... ON CONFLICT DO UPDATE SET ..." command, and the logs constantly show errors adding records to the message cache due to "duplicate key".
* Revert "Get rid of phpstan/phpstan-strict-rules"
This reverts commit ff59ade31a.
* drop phpstan baseline
* fix foreach phpstan issue
* adjust for rebase
* fix method call case
* ignore one phpstan error even after isset
In some cases, the array's keys where upper case, and the previous code
produced a warning and resulted in an empty string, even though the
name was present.
* vcard: Fix whitespace handling in line cont's
Previously, multiple whitespace characters at the start of a
continuation line would all be dropped, instead of only the first one.
Also,
- restrict line continuation characters to SPACE and TAB.
Note that, like before, this identifies the CR (`\r`) character with the
empty string, and thereby notably does not require a CRLF (`\r\n`)
sequence (which is mandated by RFCs 2426, 2425) for line termination
(i.e., `\n` suffices).
Fixes: Bug 1 of issue #9593.
* vcard: Add test for #9593/1
* Fix coding style
* Filter "real" attachments by being referenced
This changes the way in which attachments are determined to be shown as
such ("standalone"), or not ("inline").
In theory this should be determined by their Content-Disposition, but in
reality this often doesn't work.
Now we check if the Content-ID or Content-Location of the attachment is
actually being used in other parts of the message. If not, the
attachment is considered to be "standalone".
* Consider all mime-parts to check if message is empty
Previously only `parts` and `body` were checked, so mime-parts that were
classified into `attachments` and `inline_parts` didn't count – thus
messages that contained only those parts were shown blank.