Fix Bug 43112
This commit is contained in:
parent
28b531f5e3
commit
d5b88f5e9c
|
@ -208,7 +208,7 @@ define([
|
||||||
var user = this.storeUsers.findOriginalUser(m.get('userid'));
|
var user = this.storeUsers.findOriginalUser(m.get('userid'));
|
||||||
m.set({
|
m.set({
|
||||||
usercolor : user ? user.get('color') : null,
|
usercolor : user ? user.get('color') : null,
|
||||||
message : this._pickLink(Common.Utils.String.htmlEncode(m.get('message')))
|
message : this._pickLink(m.get('message'))
|
||||||
}, {silent:true});
|
}, {silent:true});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -256,14 +256,13 @@ define([
|
||||||
|
|
||||||
arr = _.sortBy(arr, function(item){ return item.start; });
|
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++) {
|
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) {
|
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;
|
return str_res;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -656,8 +656,6 @@ define([
|
||||||
|
|
||||||
pickLink: function (message) {
|
pickLink: function (message) {
|
||||||
var arr = [], offset, len;
|
var arr = [], offset, len;
|
||||||
message = Common.Utils.String.htmlEncode(message);
|
|
||||||
|
|
||||||
message.replace(Common.Utils.ipStrongRe, function(subStr) {
|
message.replace(Common.Utils.ipStrongRe, function(subStr) {
|
||||||
var result = /[\.,\?\+;:=!\(\)]+$/.exec(subStr);
|
var result = /[\.,\?\+;:=!\(\)]+$/.exec(subStr);
|
||||||
if (result)
|
if (result)
|
||||||
|
@ -699,14 +697,13 @@ define([
|
||||||
|
|
||||||
arr = _.sortBy(arr, function(item){ return item.start; });
|
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++) {
|
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) {
|
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;
|
return str_res;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue