From a56cb31edddd1926539bd615e9e5b52f7a152b15 Mon Sep 17 00:00:00 2001 From: helge Date: Fri, 18 Feb 2005 17:42:20 +0000 Subject: [PATCH] added some generic HTML escaping functions git-svn-id: http://svn.opengroupware.org/SOGo/trunk@586 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/Mailer/ChangeLog | 2 ++ SOGo/UI/Mailer/Version | 2 +- SOGo/UI/Mailer/mailer.js | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/SOGo/UI/Mailer/ChangeLog b/SOGo/UI/Mailer/ChangeLog index d53e2a7c..31a83c91 100644 --- a/SOGo/UI/Mailer/ChangeLog +++ b/SOGo/UI/Mailer/ChangeLog @@ -1,5 +1,7 @@ 2005-02-18 Helge Hess + * mailer.js: added HTML escape/unescape functions (v0.9.118) + * moved mail part viewers to own product (MailPartViewers) (v0.9.117) 2005-02-17 Helge Hess diff --git a/SOGo/UI/Mailer/Version b/SOGo/UI/Mailer/Version index 881b3900..5740babf 100644 --- a/SOGo/UI/Mailer/Version +++ b/SOGo/UI/Mailer/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=117 +SUBMINOR_VERSION:=118 # v0.9.100 requires libNGMime v4.5.213 # v0.9.99 requires libNGMime v4.5.212 diff --git a/SOGo/UI/Mailer/mailer.js b/SOGo/UI/Mailer/mailer.js index 99c682b6..5ded4a96 100644 --- a/SOGo/UI/Mailer/mailer.js +++ b/SOGo/UI/Mailer/mailer.js @@ -193,6 +193,21 @@ function clickedNewFilter(sender) { /* generic stuff */ +function escapeHTML(s) { + s = s.replace(/&/g, "&"); + s = s.replace(//g, ">"); + s = s.replace(/"/g, """); + return s; +} +function unescapeHTML(s) { + s = s.replace(/</g, "<"); + s = s.replace(/>/g, ">"); + s = s.replace(/"/g, '"'); + s = s.replace(/&/g, "&"); + return s; +} + function createHTTPClient() { // http://developer.apple.com/internet/webcontent/xmlhttpreq.html if (typeof XMLHttpRequest != "undefined") -- 2.39.5