mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
Fix file inputs being overwritten with strings.
Added force option in case we really need to overwrite
This commit is contained in:
parent
e4452b906e
commit
42cfed5fa8
2 changed files with 8 additions and 3 deletions
|
@ -515,8 +515,9 @@ class InputWaiter {
|
|||
*
|
||||
* @param {number} inputNum
|
||||
* @param {string | ArrayBuffer} value
|
||||
* @param {boolean} [force=false] - If true, forces the value to be updated even if the type is different to the currently stored type
|
||||
*/
|
||||
updateInputValue(inputNum, value) {
|
||||
updateInputValue(inputNum, value, force=false) {
|
||||
let includeInput = false;
|
||||
const recipeStr = toBase64(value, "A-Za-z0-9+/"); // B64 alphabet with no padding
|
||||
if (recipeStr.length > 0 && recipeStr.length <= 68267) {
|
||||
|
@ -534,7 +535,8 @@ class InputWaiter {
|
|||
action: "updateInputValue",
|
||||
data: {
|
||||
inputNum: inputNum,
|
||||
value: value
|
||||
value: value,
|
||||
force: force
|
||||
}
|
||||
}, transferable);
|
||||
}
|
||||
|
@ -1025,7 +1027,7 @@ class InputWaiter {
|
|||
this.manager.highlighter.removeHighlights();
|
||||
getSelection().removeAllRanges();
|
||||
|
||||
this.updateInputValue(inputNum, "");
|
||||
this.updateInputValue(inputNum, "", true);
|
||||
|
||||
this.set({
|
||||
inputNum: inputNum,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue