fix: sensitive keyword detection may produce false positives (#7881)
This commit is contained in:
@@ -341,9 +341,9 @@ class Utils {
|
||||
* @returns {Boolean} True if a match was found, false otherwise.
|
||||
*/
|
||||
static objectContainsKeyValue(obj, key, value) {
|
||||
const isMatch = (a, b) => (typeof a === 'string' && new RegExp(a).test(b)) || a === b;
|
||||
const isKeyMatch = k => isMatch(key, k);
|
||||
const isValueMatch = v => isMatch(value, v);
|
||||
const isMatch = (a, b) => (typeof a === 'string' && new RegExp(b).test(a)) || a === b;
|
||||
const isKeyMatch = k => isMatch(k, key);
|
||||
const isValueMatch = v => isMatch(v, value);
|
||||
for (const [k, v] of Object.entries(obj)) {
|
||||
if (key !== undefined && value === undefined && isKeyMatch(k)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user