diff --git a/lemmy-translations b/lemmy-translations index 91563f22..6c03b403 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 91563f222284e19def549ac5247039b398c78931 +Subproject commit 6c03b403c79bc5a893527d1fe217690db774a7ef diff --git a/src/shared/config.ts b/src/shared/config.ts index 69039532..ec1f7e13 100644 --- a/src/shared/config.ts +++ b/src/shared/config.ts @@ -33,6 +33,8 @@ export const authCookieName = "jwt"; // page on route "/communities" export const communityLimit = 50; +const queryPairRegex = "[a-zA-Zd_-]+=[a-zA-Zd+-_]+"; + /** * Accepted formats: * !community@server.com @@ -40,7 +42,9 @@ export const communityLimit = 50; * /m/community@server.com * /u/username@server.com */ -export const instanceLinkRegex = - /(\/[cmu]\/|!)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g; +export const instanceLinkRegex = new RegExp( + `(/[cmu]/|!)[a-zA-Z\\d._%+-]+@[a-zA-Z\\d.-]+\\.[a-zA-Z]{2,}(?:/?\\?${queryPairRegex}(?:&${queryPairRegex})*)?`, + "g", +); export const testHost = "0.0.0.0:8536";