From 19cf6be4c69a6a0869b7502a6a70e0960a76d443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Wed, 1 Jul 2020 11:17:28 +0200 Subject: [PATCH] Adapt to valid characters for namespace and name --- .../src/repos/components/changesets/ChangesetShortLink.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetShortLink.tsx b/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetShortLink.tsx index 13a129fc23..e4f03a351f 100644 --- a/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetShortLink.tsx +++ b/scm-ui/ui-webapp/src/repos/components/changesets/ChangesetShortLink.tsx @@ -28,12 +28,13 @@ import { Changeset } from "@scm-manager/ui-types"; import { Replacement } from "@scm-manager/ui-components"; const ChangesetShortLink: (changeset: Changeset, value: string) => Replacement[] = (changeset, value) => { - const matches = value.match(/(\w+)\/(\w+)@([a-f0-9]+)/g); + const linkRegExp = "([A-Za-z0-9\.\-_]+)\/([A-Za-z0-9\.\-_]+)@([a-f0-9]+)"; + const matches = value.match(new RegExp(linkRegExp, "g")); if (!matches) { return []; } return matches.map(value => { - const groups = value.match(/(\w+)\/(\w+)@([a-f0-9]+)/); + const groups = value.match(new RegExp(linkRegExp)); const namespace = groups[1]; const name = groups[2]; const revision = groups[3];