From 3401810fac51aac5fc75a1320be29f8a475efd1c Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Wed, 22 Jul 2020 14:32:10 +0200 Subject: [PATCH] Improve XMPP regex --- assets/scripts.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/scripts.js b/assets/scripts.js index 5e2eb69..bf3574b 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -535,7 +535,9 @@ async function verifyProof(url, fingerprint) { // XMPP if (/^xmpp:/.test(url)) { output.type = "xmpp"; - match = url.match(/xmpp:(.*)@(.*)/); + console.log(url); + match = url.match(/xmpp:([a-zA-Z0-9\.\-\_]*)@([a-zA-Z0-9\.\-\_]*)(?:\?(.*))?/); + console.log(match); output.display = `${match[1]}@${match[2]}`; output.proofUrl = `https://xmpp-vcard.keyoxide.org/api/vcard/${output.display}/DESC`; try {