Bug 1938933 - Switch from deprecated escape/unescape in cZ. r=frg DONTBUILD
--- a/suite/chatzilla/js/lib/dcc.js
+++ b/suite/chatzilla/js/lib/dcc.js
@@ -258,17 +258,17 @@ function CIRCDCCUser(parent, user, remot
this.parent = parent;
this.netUser = user;
this.id = parent.getNextID();
this.unicodeName = user.unicodeName;
this.viewName = user.unicodeName;
this.canonicalName = user.collectionKey.substr(1);
this.remoteIP = remoteIP;
- this.key = escape(user.collectionKey) + ":" + remoteIP;
+ this.key = encodeURIComponent(user.collectionKey) + ":" + remoteIP;
user.dccUser = this;
this.parent.users[this.key] = this;
if ("onInit" in this) {
this.onInit();
}
return this;
--- a/suite/chatzilla/js/lib/pref-manager.js
+++ b/suite/chatzilla/js/lib/pref-manager.js
@@ -186,28 +186,28 @@ PrefManager.prototype.updateArrayPref =
this.delayedSave();
};
PrefManager.prototype.stringToArray = function pm_s2a(string) {
if (string.search(/\S/) == -1) {
return [];
}
- var ary = string.split(/\s*;\s*/);
- for (var i = 0; i < ary.length; ++i) {
- ary[i] = toUnicode(unescape(ary[i]), PREF_CHARSET);
+ let ary = new Array();
+ for (let item of string.split(/\s*;\s*/)) {
+ ary.push(toUnicode(decodeURIComponent(item), PREF_CHARSET));
}
return ary;
};
PrefManager.prototype.arrayToString = function pm_a2s(ary) {
var escapedAry = new Array();
- for (var i = 0; i < ary.length; ++i) {
- escapedAry[i] = escape(fromUnicode(ary[i], PREF_CHARSET));
+ for (let item of ary) {
+ escapedAry.push(encodeURIComponent(fromUnicode(item, PREF_CHARSET)));
}
return escapedAry.join("; ");
};
PrefManager.prototype.getPref = function pm_getpref(prefName, reload) {
var prefManager = this;
--- a/suite/chatzilla/xul/content/commands.js
+++ b/suite/chatzilla/xul/content/commands.js
@@ -1350,18 +1350,18 @@ function cmdTestDisplay(e) {
test(sampleUser, me); /* from user to me */
test(me, sampleUser); /* me to user */
display(MSG_TEST_URL, "PRIVMSG", sampleUser, me);
display(MSG_TEST_STYLES, "PRIVMSG", sampleUser, me);
display(MSG_TEST_EMOTICON, "PRIVMSG", sampleUser, me);
display(MSG_TEST_RHEET, "PRIVMSG", sampleUser, me);
- display(unescape(MSG_TEST_CTLCHR), "PRIVMSG", sampleUser, me);
- display(unescape(MSG_TEST_COLOR), "PRIVMSG", sampleUser, me);
+ display(decodeURIComponent(MSG_TEST_CTLCHR), "PRIVMSG", sampleUser, me);
+ display(decodeURIComponent(MSG_TEST_COLOR), "PRIVMSG", sampleUser, me);
display(MSG_TEST_QUOTE, "PRIVMSG", sampleUser, me);
if (e.channel) {
test(sampleUser, sampleChannel); /* user to channel */
test(me, sampleChannel); /* me to channel */
display(MSG_TEST_TOPIC, "TOPIC", sampleUser, sampleChannel);
display(MSG_TEST_JOIN, "JOIN", sampleUser, sampleChannel);
display(MSG_TEST_PART, "PART", sampleUser, sampleChannel);