Skip to content

Commit

Permalink
Fixed populateOption HTML escape bug. Closes #490
Browse files Browse the repository at this point in the history
  • Loading branch information
n1474335 committed Feb 8, 2019
1 parent 7d09ba5 commit 3d20833
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/operations/RegularExpression.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function regexHighlight (input, regex, displayTotal) {
if (groups.length) {
title += "Groups:\n";
for (let i = 0; i < groups.length; i++) {
title += `\t${i+1}: ${Utils.escapeHtml(groups[i])}\n`;
title += `\t${i+1}: ${Utils.escapeHtml(groups[i] || "")}\n`;
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/web/HTMLIngredient.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @license Apache-2.0
*/

import Utils from "../core/Utils";

/**
* Object to handle the creation of operation ingredients.
*/
Expand Down Expand Up @@ -156,7 +158,7 @@ class HTMLIngredient {
} else if ((m = this.value[i].name.match(/\[\/([a-z0-9 -()^]+)\]/i))) {
html += "</optgroup>";
} else {
html += `<option populate-value="${this.value[i].value}">${this.value[i].name}</option>`;
html += `<option populate-value="${Utils.escapeHtml(this.value[i].value)}">${this.value[i].name}</option>`;
}
}
html += `</select>
Expand Down

0 comments on commit 3d20833

Please sign in to comment.