Roundcube Community Forum

 

mailto: body inserted with html tag "payload"

Started by MASHtm, February 23, 2016, 10:06:59 AM

Previous topic - Next topic

MASHtm

Hi!

If I do the following:
*) Edit a new text/plain message with thunderbird and add
mailto:[email protected]?subject=test%20test&body=Test
*) save the message to Drafts
*) open it in RoundCube 1.1.4 and click the link (mailto: handler is not registered!)

I end up in the RoundCube Compose Screen in Textmode (regardless of my settings, even if "always HTML" is default) and the body textarea contains
<!-- html ignored --><!-- head ignored --><!-- meta ignored --><body><p>Test</p></body>

Browser used: Firefox 44.0.2 on Fedora 23

Things I tried without success (and same result)
*) removing my .sig made no difference
*) Edit as HTML in Thunderbird and add a full href mailto:
*) composing the message in Roundcube as text message and simply adding the same mailto:, save, open, click the link

Is it me doing something wrong, or is this some sort of bug?

Greetings, MASHtm

JohnDoh

Happens for me with git-master so i think it might be a bug.

I would say open a ticket on trac so the devs can take a look but I see that trac has just been closed to new users while some changes are taking place. The devs do check the forum sometimes else this will have to wait for the new bug tracker.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...


MASHtm

Quote from: alec on February 24, 2016, 05:19:20 AM
Hopefully this fixes the issue https://github.com/roundcube/roundcubemail/commit/b0a8e3693090bd96fc31c4c5f42b77f8fddf9b90

Thanks for the fast response! Meanwhile I came up with the following patch myself:
--- roundcubemail/program/steps/mail/compose.inc 2015-12-23 10:18:12.000000000 +0100
+++ roundcubemail-dev/program/steps/mail/compose.inc 2016-02-24 11:21:05.949702333 +0100
@@ -734,6 +735,11 @@
     else if ($COMPOSE['param']['body']) {
         $body   = $COMPOSE['param']['body'];
         $isHtml = (bool) $COMPOSE['param']['html'];
+        //html_washer always returns HTML. convert to text if needed
+        if (! $isHtml) {
+            $txt = new rcube_html2text($body);
+            $body = $txt->get_text();
+        }
     }
     // forward as attachment
     else if ($compose_mode == RCUBE_COMPOSE_FORWARD && $COMPOSE['as_attachment']) {


Since html_washer always returns HTML I translate it back with html2text if text mode is selected. At least it works here. Did I miss something fundamental?

Will try your patch as well anyway.