Skip to content

Commit

Permalink
Escape HTML in CSS dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Feb 7, 2014
1 parent 3a5e44e commit c94595e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions UI/WebServerResources/SchedulerUI.js
Expand Up @@ -265,7 +265,7 @@ function deleteEvent() {
content = nodes[i].allTextContent();
}
itemElement.appendChild(colorBox);
itemElement.appendChild(new Element('span').update(content));
itemElement.appendChild(new Element('span').update(content.escapeHTML()));
if (nodes[i].startDate) {
var startDate = new Date(nodes[i].startDate*1000);
var dateElement = new Element('div', {'class': 'muted'});
Expand Down Expand Up @@ -332,7 +332,7 @@ function deleteEvent() {
}
}
itemElement.appendChild(colorBox);
itemElement.appendChild(new Element('span').update(content));
itemElement.appendChild(new Element('span').update(content.escapeHTML()));
if (selectedCalendarCell[i].startDate) {
var startDate = new Date(selectedCalendarCell[i].startDate*1000);
var dateElement = new Element('div', {'class': 'muted'});
Expand Down
8 changes: 4 additions & 4 deletions UI/WebServerResources/generic.js
Expand Up @@ -1467,7 +1467,7 @@ function showAlarmCallback(http) {
if (data["description"].length)
msg += "\n\n" + data["description"];

window.alert(msg);
window.alert(msg.unescapeHTML());
showSelectDialog(data["summary"], _('Snooze for '),
{ '5': _('5 minutes'),
'10': _('10 minutes'),
Expand Down Expand Up @@ -1983,7 +1983,7 @@ function createDialog(id, title, legend, content, positionClass) {
var subdiv = createElement("div", null, null, null, null, newDialog);
if (title && title.length > 0) {
var titleh3 = createElement("h3", null, null, null, null, subdiv);
titleh3.appendChild(document.createTextNode(title));
titleh3.update(title);
}
if (legend) {
if (Object.isElement(legend))
Expand Down Expand Up @@ -2141,14 +2141,14 @@ function _showSelectDialog(title, label, options, button, callbackFcn, callbackA
}
else {
var fields = createElement("p", null, []);
fields.appendChild(document.createTextNode(label));
fields.update(label);
var select = createElement("select"); //, null, null, { cname: name } );
fields.appendChild(select);
var values = $H(options).keys();
for (var i = 0; i < values.length; i++) {
var option = createElement("option", null, null,
{ value: values[i] }, null, select);
option.appendChild(document.createTextNode(options[values[i]]));
option.update(options[values[i]]);
}
fields.appendChild(createElement("br"));

Expand Down

0 comments on commit c94595e

Please sign in to comment.