mirror of
https://github.com/gchq/CyberChef
synced 2026-01-16 07:23:24 +00:00
Fix file inputs being overwritten with strings.
Added force option in case we really need to overwrite
This commit is contained in:
@@ -546,10 +546,13 @@ self.updateInputProgress = function(inputData) {
|
||||
* @param {object} inputData
|
||||
* @param {number} inputData.inputNum - The input that's having its value updated
|
||||
* @param {string | ArrayBuffer} inputData.value - The new value of the input
|
||||
* @param {boolean} inputData.force - If true, still updates the input value if the input type is different to the stored value
|
||||
*/
|
||||
self.updateInputValue = function(inputData) {
|
||||
const inputNum = inputData.inputNum;
|
||||
if (inputNum < 1) return;
|
||||
if (Object.prototype.hasOwnProperty.call(self.inputs[inputNum].data, "fileBuffer") &&
|
||||
typeof inputData.value === "string" && !inputData.force) return;
|
||||
const value = inputData.value;
|
||||
if (self.inputs[inputNum] !== undefined) {
|
||||
if (typeof value === "string") {
|
||||
|
||||
Reference in New Issue
Block a user