Opened 4 years ago
Closed 4 years ago
#1485676 closed Bugs (fixed)
wrong reply body for text message with html attachment
| Reported by: | alec | Owned by: | thomasb |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.2.1 |
| Component: | Core functionality | Version: | 0.2-stable |
| Severity: | normal | Keywords: | reply body html |
| Cc: |
Description
I have a text/plain message with html inline attachment (m/mixed not m/alternative). When I try to reply with html editor enabled, body contains the html attachment contents instead of plain text part. I'm not sure that reply body should contain attachment body, but definitely should contain the message (text) body.
Attachments (1)
Change History (8)
comment:1 Changed 4 years ago by alec
comment:2 Changed 4 years ago by linuxmagic
Haven't been able to reproduce this so far... was this with a particular browser? PHP version > 5.2 ?
comment:3 follow-up: ↓ 4 Changed 4 years ago by alec
Sorry, the problem is with html message with html attachment. Steps to reproduce: 1. Create html message with html attachment. 2. Enable HTML editor by default. 3. Click reply to that message. Result: you have only attachment body in editor.
comment:4 in reply to: ↑ 3 Changed 4 years ago by linuxmagic
Replying to alec:
Sorry, the problem is with html message with html attachment. Steps to reproduce: 1. Create html message with html attachment. 2. Enable HTML editor by default. 3. Click reply to that message. Result: you have only attachment body in editor.
Thank you for clarifying. There are actually two distinct issues here.
In the file program/include/rcube_message.php, the function "first_html_part()" is not breaking it's loop upon actually finding the first mimetype of 'text/html' - so it will always return the last. Adding a 'return' statement should resolve that.
The second issue is if a message has been drafted with a body of text/plain, but has an HTML attachment, then it will always show the attachment in the compose body. I'm not sure how that can be fixed though shy of ignoring any/all mime types and simply grabbing the first part, regardless of type - though that could be tricky.
I will attach a patch for the first_html_part() function.
Changed 4 years ago by linuxmagic
comment:5 Changed 4 years ago by alec
Patch applied in [19d1b28c]. We still need fix for such drafts handling [1] and washtml'ing reply body [2].
comment:6 Changed 4 years ago by alec
Update: I've tested [1] issue and it works for me. Text/plain message with attachment is properly opened in non-html mode.
comment:7 Changed 4 years ago by alec
- Resolution set to fixed
- Status changed from new to closed
Fixed in [ec603f7d].

...also shouldn't be washtml class used for html messages on reply/forward?