diff --git a/apps/common/main/lib/view/Chat.js b/apps/common/main/lib/view/Chat.js index 03bee46be..b27e492e2 100644 --- a/apps/common/main/lib/view/Chat.js +++ b/apps/common/main/lib/view/Chat.js @@ -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; i0) { - 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; }, diff --git a/apps/common/main/lib/view/Comments.js b/apps/common/main/lib/view/Comments.js index 33aa6d1ee..bdb95b10a 100644 --- a/apps/common/main/lib/view/Comments.js +++ b/apps/common/main/lib/view/Comments.js @@ -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; i0) { - 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; },