Fix Bug 43112

This commit is contained in:
Julia Radzhabova 2019-10-08 17:43:24 +03:00
parent 28b531f5e3
commit d5b88f5e9c
2 changed files with 7 additions and 11 deletions

View file

@ -208,7 +208,7 @@ define([
var user = this.storeUsers.findOriginalUser(m.get('userid'));
m.set({
usercolor : user ? user.get('color') : null,
message : this._pickLink(Common.Utils.String.htmlEncode(m.get('message')))
message : this._pickLink(m.get('message'))
}, {silent:true});
},
@ -256,14 +256,13 @@ define([
arr = _.sortBy(arr, function(item){ return item.start; });
var str_res = (arr.length>0) ? ( message.substring(0, arr[0].start) + arr[0].str) : message;
var str_res = (arr.length>0) ? ( Common.Utils.String.htmlEncode(message.substring(0, arr[0].start)) + arr[0].str) : Common.Utils.String.htmlEncode(message);
for (var i=1; i<arr.length; i++) {
str_res += (message.substring(arr[i-1].end, arr[i].start) + arr[i].str);
str_res += (Common.Utils.String.htmlEncode(message.substring(arr[i-1].end, arr[i].start)) + arr[i].str);
}
if (arr.length>0) {
str_res += message.substring(arr[i-1].end, message.length);
str_res += Common.Utils.String.htmlEncode(message.substring(arr[i-1].end, message.length));
}
return str_res;
},

View file

@ -656,8 +656,6 @@ define([
pickLink: function (message) {
var arr = [], offset, len;
message = Common.Utils.String.htmlEncode(message);
message.replace(Common.Utils.ipStrongRe, function(subStr) {
var result = /[\.,\?\+;:=!\(\)]+$/.exec(subStr);
if (result)
@ -699,14 +697,13 @@ define([
arr = _.sortBy(arr, function(item){ return item.start; });
var str_res = (arr.length>0) ? ( message.substring(0, arr[0].start) + arr[0].str) : message;
var str_res = (arr.length>0) ? ( Common.Utils.String.htmlEncode(message.substring(0, arr[0].start)) + arr[0].str) : Common.Utils.String.htmlEncode(message);
for (var i=1; i<arr.length; i++) {
str_res += (message.substring(arr[i-1].end, arr[i].start) + arr[i].str);
str_res += (Common.Utils.String.htmlEncode(message.substring(arr[i-1].end, arr[i].start)) + arr[i].str);
}
if (arr.length>0) {
str_res += message.substring(arr[i-1].end, message.length);
str_res += Common.Utils.String.htmlEncode(message.substring(arr[i-1].end, message.length));
}
return str_res;
},