mirror of
https://github.com/gchq/CyberChef
synced 2025-01-01 07:18:47 +00:00
use Utils.escapeHtml instead of manual escaping
This commit is contained in:
parent
d9d6b7aa37
commit
ab283fc801
1 changed files with 2 additions and 3 deletions
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
|
import Utils from "../Utils.mjs";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import {DATETIME_FORMATS, FORMAT_EXAMPLES} from "../lib/DateTime.mjs";
|
import {DATETIME_FORMATS, FORMAT_EXAMPLES} from "../lib/DateTime.mjs";
|
||||||
|
|
||||||
|
@ -85,9 +86,7 @@ class TranslateDateTimeFormat extends Operation {
|
||||||
if (data === this.invalidFormatMessage) {
|
if (data === this.invalidFormatMessage) {
|
||||||
return `${data}\n\n${FORMAT_EXAMPLES}`;
|
return `${data}\n\n${FORMAT_EXAMPLES}`;
|
||||||
}
|
}
|
||||||
return data.replace(/&/g, "&")
|
return Utils.escapeHtml(data);
|
||||||
.replace(/</g, "<")
|
|
||||||
.replace(/>/g, ">");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue