Fix bug causing false positive verification

This commit is contained in:
Yarmo Mackenbach 2021-03-25 13:21:49 +01:00
parent 71f31bfb9e
commit 1db8683886
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -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/, ''))