diff --git a/CHANGELOG b/CHANGELOG index 486a73a8f..02d9d66f8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix handling HTML entities when converting HTML to text (#1488212) - Fix fit_string_to_size() renders browser and ui unresponsive (#1488207) - Fix handling of invalid characters in request (#1488124) - Fix merging some configuration options in update.sh script (#1485864) diff --git a/program/js/app.js b/program/js/app.js index 22ff4c98f..f17e2f432 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -5765,10 +5765,13 @@ function rcube_webmail() }); }; - this.plain2html = function(plainText, id) + this.plain2html = function(plain, id) { var lock = this.set_busy(true, 'converting'); - $('#'+id).val(plainText ? '
'+plainText+'
' : ''); + + plain = plain.replace(/&/g, '&').replace(//g, '>'); + $('#'+id).val(plain ? '
'+plain+'
' : ''); + this.set_busy(false, null, lock); }; diff --git a/program/lib/html2text.php b/program/lib/html2text.php index 1ab16055b..9fc96eac7 100644 --- a/program/lib/html2text.php +++ b/program/lib/html2text.php @@ -145,7 +145,6 @@ class html2text var $search = array( "/\r/", // Non-legal carriage return "/[\n\t]+/", // Newlines and tabs - '/[ ]{2,}/', // Runs of spaces, pre-handling '/]*>.*?<\/script>/i', //