[RCD] bug: html spellcheck on send

Brendan brendan at tucows.com
Mon Apr 25 20:00:01 CEST 2016


in roundcube-1.1.4 (and almost certainly other versions), we have
noticed the following behavior (using the enchant spell engine):

if you have a link (ie, {a href="http://blhblh.com"}Happy{/a} - brackets
changed so no one's email client interprets them as a link) in an html
email, the behavior of using the spellcheck button is different than
when you go to send the email (and are configured to check spelling upon
send).

with the spellcheck button the client only passes the plain text through
to the spellcheck engine, ie:

Happy

when sending, the client sends the full html and before being passed to
the spellcheck engine it gets converted into text email content, ie:

Happy [1]

Links:
------
[1] http://blhblh.com

the enchant spell engine then throws errors on "http" and "blhblh.com",
both of which it really ought to be ignoring.

i see two different solutions:

1) in program/lib/Roundcube/rcube_spellchecker.php function check(),
replace:
  $this->content = $this->html2text($text);
with:
  $this->content = strip_tags($text);

2) in program/lib/Roundcube/rcube_spellchecker_enchant.php (and
rcube_spellchecker_pspell.php, etc) function check(), add in a regex to
strip out lines matching /^\[\d+\] http:\/\/.*/ prior to tokenizing the
text.

#1 seems cleaner, but i'm not sure if there is a reason we need to use
html2text there. does anyone from kolab have any input on the preferred
way to deal with this?


More information about the dev mailing list