mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
Calls to window and document in src/core/ no longer break non-browser environments
This commit is contained in:
@@ -388,7 +388,7 @@ const Utils = {
|
||||
var wordArray = CryptoJS.enc.Utf8.parse(str),
|
||||
byteArray = Utils.wordArrayToByteArray(wordArray);
|
||||
|
||||
if (str.length !== wordArray.sigBytes)
|
||||
if (window && str.length !== wordArray.sigBytes)
|
||||
window.app.options.attemptHighlight = false;
|
||||
return byteArray;
|
||||
},
|
||||
@@ -440,7 +440,7 @@ const Utils = {
|
||||
var wordArray = new CryptoJS.lib.WordArray.init(words, byteArray.length),
|
||||
str = CryptoJS.enc.Utf8.stringify(wordArray);
|
||||
|
||||
if (str.length !== wordArray.sigBytes)
|
||||
if (window && str.length !== wordArray.sigBytes)
|
||||
window.app.options.attemptHighlight = false;
|
||||
return str;
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user