From 1db8683886b0f0f65d5070d7bf35be7d9545e13f Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Thu, 25 Mar 2021 13:21:49 +0100 Subject: [PATCH] Fix bug causing false positive verification --- src/claims.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/claims.js b/src/claims.js index 0bb7457..f3a99ca 100644 --- a/src/claims.js +++ b/src/claims.js @@ -114,7 +114,10 @@ const runVerification = (proofData, spData) => { break case 'text': re = new RegExp( - utils.generateClaim(spData.claim.fingerprint, spData.claim.format), + utils + .generateClaim(spData.claim.fingerprint, spData.claim.format) + .replace('[', '\\[') + .replace(']', '\\]'), 'gi' ) res.isVerified = re.test(proofData.replace(/\r?\n|\r/, ''))