Node.js based forum software built for the modern web
fix(activitypub): recognize non-ASCII webfinger handles (#14466)
Enes Uysal5b9b17449e55
diff --git a/public/src/modules/search.js b/public/src/modules/search.jsindex 754b1210a8..7ffe42226b 100644--- a/public/src/modules/search.js+++ b/public/src/modules/search.js@@ -26,7 +26,7 @@ define('search', [const quickSearchContainer = searchFields.find('#quick-search-container');const toggleVisibility = searchFields.hasClass('hidden');- const webfingerRegex = /^(@|acct:)?[\w-]+@.+$/; // should match src/activitypub/helpers.js+ const webfingerRegex = /^(@|acct:)?[\p{L}\p{N}\p{M}_.-]+@.+$/u;if (toggleVisibility) {searchFields.off('focusout').on('focusout', function dismissSearch() {diff --git a/src/activitypub/helpers.js b/src/activitypub/helpers.jsindex 1d3122068c..18dc506a80 100644--- a/src/activitypub/helpers.js+++ b/src/activitypub/helpers.js@@ -19,7 +19,8 @@ const ttl = require('../cache/ttl');const user = require('../user');const activitypub = require('.');-const webfingerRegex = /^(@|acct:)?[\w-.]+@.+$/;+// \w only matches ASCII, so match unicode letters/numbers/marks explicitly to support non-ASCII handles+const webfingerRegex = /^(@|acct:)?[\p{L}\p{N}\p{M}_.-]+@.+$/u;const webfingerCache = ttl({name: 'ap-webfinger-cache',max: 5000,