Skip to content

Commit

Permalink
use dojo.string.escape
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul committed Jan 23, 2020
1 parent 6eb2783 commit 93cd816
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions xmpp/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,8 @@ dojo.provide("dojox.xmpp.util");
dojo.require("dojox.string.Builder");
dojo.require("dojox.encoding.base64");

var xmlEntityMap = {
'&': '&',
'>': '>',
'<': '&lt;',
'\'': '&apos;',
'"': '&quot;'
};
var xmlEntityRegex = /(&|>|<|'|")/g;

dojox.xmpp.util.xmlEncode = function(str) {
if(str) {
str = str.replace(xmlEntityRegex, function (match) {
return xmlEntityMap[match] || '';
})
}
return str;
return dojo.string.escape(str);
};

dojox.xmpp.util.encodeJid = function(jid) {
Expand Down

0 comments on commit 93cd816

Please sign in to comment.