Skip to content

Commit

Permalink
Trying a different approach to solve the security hotspot issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
mamartinezmejia committed Sep 25, 2023
1 parent f34029d commit 0f7d6f2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frontend/src/helpers/validators/GlobalValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,8 @@ export const runValidation = (
}

try {
return eval(condition);
}
catch (error) {
return Function('"use strict";return (' + condition + ')').call(target, item);
} catch (error) {
console.error("Error evaluating condition:", error);
return false;
}
Expand All @@ -343,7 +342,6 @@ export const runValidation = (
return "";
}
} catch (error) {
// Handle any potential errors in the condition evaluation
console.error("Error executing validation:", error);
return "";
}
Expand Down

0 comments on commit 0f7d6f2

Please sign in to comment.