mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
BUGFIX #119: Recipe names are now correctly escaped.
This commit is contained in:
parent
0f02fb5d05
commit
4375a151dd
1 changed files with 3 additions and 2 deletions
|
@ -244,7 +244,7 @@ ControlsWaiter.prototype.loadClick = function() {
|
||||||
* Saves the recipe specified in the save textarea to local storage.
|
* Saves the recipe specified in the save textarea to local storage.
|
||||||
*/
|
*/
|
||||||
ControlsWaiter.prototype.saveButtonClick = function() {
|
ControlsWaiter.prototype.saveButtonClick = function() {
|
||||||
var recipeName = document.getElementById("save-name").value,
|
var recipeName = Utils.escapeHtml(document.getElementById("save-name").value),
|
||||||
recipeStr = document.getElementById("save-text").value;
|
recipeStr = document.getElementById("save-text").value;
|
||||||
|
|
||||||
if (!recipeName) {
|
if (!recipeName) {
|
||||||
|
@ -288,7 +288,8 @@ ControlsWaiter.prototype.populateLoadRecipesList = function() {
|
||||||
for (i = 0; i < savedRecipes.length; i++) {
|
for (i = 0; i < savedRecipes.length; i++) {
|
||||||
var opt = document.createElement("option");
|
var opt = document.createElement("option");
|
||||||
opt.value = savedRecipes[i].id;
|
opt.value = savedRecipes[i].id;
|
||||||
opt.innerHTML = savedRecipes[i].name;
|
// Unescape then re-escape in case localStorage has been corrupted
|
||||||
|
opt.innerHTML = Utils.escapeHtml(Utils.unescapeHtml(savedRecipes[i].name));
|
||||||
|
|
||||||
loadNameEl.appendChild(opt);
|
loadNameEl.appendChild(opt);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue