summaryrefslogtreecommitdiffstats
path: root/js/globals.js
diff options
context:
space:
mode:
authorOndrej Zara <ondrej.zara@firma.seznam.cz>2015-08-04 16:36:30 +0200
committerOndrej Zara <ondrej.zara@firma.seznam.cz>2015-08-04 16:36:30 +0200
commit921ccb4b2139f6239da2ad76f07217775c281ea8 (patch)
treee1e42f5ef32d31429578dbbc343a7a59073f2256 /js/globals.js
parenta8f650f5c14a5d3a194ce470a49c6c483c91e9a9 (diff)
downloadwwwsqldesigner-921ccb4b2139f6239da2ad76f07217775c281ea8.zip
wwwsqldesigner-921ccb4b2139f6239da2ad76f07217775c281ea8.tar.gz
wwwsqldesigner-921ccb4b2139f6239da2ad76f07217775c281ea8.tar.bz2
xml escaping, fixes #207
Diffstat (limited to 'js/globals.js')
-rw-r--r--js/globals.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/globals.js b/js/globals.js
index 29f62c5..46c7699 100644
--- a/js/globals.js
+++ b/js/globals.js
@@ -53,6 +53,10 @@ var SQL = {
unsubscribe: function(message, subscriber) {
var index = this._subscribers[message].indexOf(subscriber);
if (index > -1) { this._subscribers[message].splice(index, 1); }
+ },
+
+ escape: function(str) {
+ return str.replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;");
}
}