summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-11-28 08:10:44 +0000
committeralecpl <alec@alec.pl>2011-11-28 08:10:44 +0000
commitca0cd05973b468c056a682ab1fb9133856a56943 (patch)
tree83b36c9b087c180df7e3070f7db8acebe887058b /program/js/app.js
parent79db33098381dd843cd8b9a1932688d3bafd5cc4 (diff)
- Fix handling HTML entities when converting HTML to text (#1488212)
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js7
1 files changed, 5 insertions, 2 deletions
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 ? '<pre>'+plainText+'</pre>' : '');
+
+ plain = plain.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+ $('#'+id).val(plain ? '<pre>'+plain+'</pre>' : '');
+
this.set_busy(false, null, lock);
};