Browse Source

Properly sanitize room names in chat.

pull/13/merge
Simon Eisenmann 11 years ago
parent
commit
37f406235f
  1. 4
      static/js/directives/chat.js

4
static/js/directives/chat.js

@ -20,7 +20,7 @@
*/ */
define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'], function(_, templateChat, templateChatroom) { define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'], function(_, templateChat, templateChatroom) {
return ["$compile", "safeDisplayName", "mediaStream", "safeApply", "desktopNotify", "translation", "playSound", "fileUpload", "randomGen", "buddyData", "$timeout", function($compile, safeDisplayName, mediaStream, safeApply, desktopNotify, translation, playSound, fileUpload, randomGen, buddyData, $timeout) { return ["$compile", "safeDisplayName", "mediaStream", "safeApply", "desktopNotify", "translation", "playSound", "fileUpload", "randomGen", "buddyData", "$timeout", "$sanitize", function($compile, safeDisplayName, mediaStream, safeApply, desktopNotify, translation, playSound, fileUpload, randomGen, buddyData, $timeout, $sanitize) {
var displayName = safeDisplayName; var displayName = safeDisplayName;
var group_chat_id = ""; var group_chat_id = "";
@ -421,7 +421,7 @@ define(['underscore', 'text!partials/chat.html', 'text!partials/chatroom.html'],
scope.$on("room", function(event, room) { scope.$on("room", function(event, room) {
var subscope = scope.showGroupRoom(null, {restore: true, noenable: true, noactivate: true}); var subscope = scope.showGroupRoom(null, {restore: true, noenable: true, noactivate: true});
if (room) { if (room) {
var msg = translation._("You are now in room %s ...", room); var msg = translation._("You are now in room %s ...", $sanitize(room));
subscope.$broadcast("display", null, $("<i><span>"+msg+"</span></i>")); subscope.$broadcast("display", null, $("<i><span>"+msg+"</span></i>"));
} }
}); });

Loading…
Cancel
Save