mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
use Utils.escapeHtml instead of manual escaping
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import Operation from "../Operation.mjs";
|
||||
import Utils from "../Utils.mjs";
|
||||
import moment from "moment-timezone";
|
||||
import {DATETIME_FORMATS, FORMAT_EXAMPLES} from "../lib/DateTime.mjs";
|
||||
|
||||
@@ -85,9 +86,7 @@ class TranslateDateTimeFormat extends Operation {
|
||||
if (data === this.invalidFormatMessage) {
|
||||
return `${data}\n\n${FORMAT_EXAMPLES}`;
|
||||
}
|
||||
return data.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">");
|
||||
return Utils.escapeHtml(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user