KMail: Attachments containing '#' cannot be opened #119

Open
opened 3 weeks ago by pschwabauer · 3 comments
Collaborator

Description

All characters after the '#' in the filename will be truncated. Because of this, it is not possible to open attachments that contain this character.

For example, if the filename is test#test.png, KMail will open /tmp/xxx/test and not /tmp/xxx/test#test.png. If the filename is #test.png, it will try to open /tmp/xxx.

The reason is that in KMReaderWin::tempFileUrlFromPartNode the file path is not correctly escaped.
See the documentation for KURL on how to properly escape the file path: https://trinitydesktop.org/docs/trinity/tdelibs/tdecore/html/classKURL.html#details

Steps to reproduce

  1. Write a mail and attach an image with the filename test#test.png
  2. Send and open the mail
  3. Try to open the attachment
## Description All characters after the '#' in the filename will be truncated. Because of this, it is not possible to open attachments that contain this character. For example, if the filename is `test#test.png`, KMail will open `/tmp/xxx/test` and not `/tmp/xxx/test#test.png`. If the filename is `#test.png`, it will try to open `/tmp/xxx`. The reason is that in [KMReaderWin::tempFileUrlFromPartNode](https://mirror.git.trinitydesktop.org/gitea/TDE/tdepim/src/commit/32a1708de3fa27aa6b434c6cdb7b540edda9eef2/kmail/kmreaderwin.cpp#L2693) the file path is not correctly escaped. See the documentation for `KURL` on how to properly escape the file path: https://trinitydesktop.org/docs/trinity/tdelibs/tdecore/html/classKURL.html#details ## Steps to reproduce 1. Write a mail and attach an image with the filename `test#test.png` 2. Send and open the mail 3. Try to open the attachment
Owner

@pschwabauer will you work on a fix for this?

@pschwabauer will you work on a fix for this?
Poster
Collaborator

@pschwabauer will you work on a fix for this?

Yes, I will submit a pull request in the coming days.

> @pschwabauer will you work on a fix for this? Yes, I will submit a pull request in the coming days.
Owner

Great, thank you. Keep in mind we are under soft freeze for R14.1.2, so the PR will be merged after that and will end up in R14.1.3.

Great, thank you. Keep in mind we are under soft freeze for R14.1.2, so the PR will be merged after that and will end up in R14.1.3.
pschwabauer referenced this issue from a commit 2 weeks ago
pschwabauer referenced this issue from a commit 21 hours ago
SlavekB referenced this issue from a commit 13 hours ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/tdepim#119
Loading…
There is no content yet.