mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Fix filtering to work on all the data and not just the result snippet
This commit is contained in:
parent
283d7f2159
commit
367d79e820
1 changed files with 13 additions and 15 deletions
|
@ -276,6 +276,7 @@ class Magic {
|
||||||
let results = [];
|
let results = [];
|
||||||
|
|
||||||
// Record the properties of the current data
|
// Record the properties of the current data
|
||||||
|
if (filter == null || new RegExp(filter).test(this.inputStr)){
|
||||||
results.push({
|
results.push({
|
||||||
recipe: recipeConfig,
|
recipe: recipeConfig,
|
||||||
data: this.inputStr.slice(0, 100),
|
data: this.inputStr.slice(0, 100),
|
||||||
|
@ -286,7 +287,7 @@ class Magic {
|
||||||
matchingOps: matchingOps,
|
matchingOps: matchingOps,
|
||||||
useful: useful
|
useful: useful
|
||||||
});
|
});
|
||||||
|
}
|
||||||
const prevOp = recipeConfig[recipeConfig.length - 1];
|
const prevOp = recipeConfig[recipeConfig.length - 1];
|
||||||
|
|
||||||
// Execute each of the matching operations, then recursively call the speculativeExecution()
|
// Execute each of the matching operations, then recursively call the speculativeExecution()
|
||||||
|
@ -331,10 +332,7 @@ class Magic {
|
||||||
r.fileType || // A file was found
|
r.fileType || // A file was found
|
||||||
r.isUTF8 || // UTF-8 was found
|
r.isUTF8 || // UTF-8 was found
|
||||||
r.matchingOps.length // A matching op was found
|
r.matchingOps.length // A matching op was found
|
||||||
) &&
|
)
|
||||||
(
|
|
||||||
filter == null || // Either no filter was passed, or
|
|
||||||
new RegExp(filter).test(r.data)) // the filter matches the result data
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Return a sorted list of possible recipes along with their properties
|
// Return a sorted list of possible recipes along with their properties
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue