From 8e0950ded948672833c643ae531ae86828bdd24f Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Tue, 25 Feb 2025 15:43:46 +1300 Subject: [PATCH] Fix client-side MXID validation --- src/web/pug/guild.pug | 2 +- src/web/pug/log-in-with-matrix.pug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/pug/guild.pug b/src/web/pug/guild.pug index 6367887..a237bbf 100644 --- a/src/web/pug/guild.pug +++ b/src/web/pug/guild.pug @@ -60,7 +60,7 @@ block body form.d-grid.g-af-column.gy4.gx8.jc-start(method="post" action="/api/invite" hx-post="/api/invite" hx-trigger="submit" hx-swap="none" hx-on::after-request="if (event.detail.successful) this.reset()" hx-disabled-elt="input, button" hx-indicator="#invite-button") label.s-label(for="mxid") Matrix ID - input.fl-grow1.s-input.wmx3#mxid(name="mxid" required placeholder="@user:example.org" pattern="@([^:]+):([a-z0-9:\-]+\.[a-z0-9.:\-]+)") + input.fl-grow1.s-input.wmx3#mxid(name="mxid" required placeholder="@user:example.org" pattern="@([^:]+):([a-z0-9:\\-]+\\.[a-z0-9.:\\-]+)") label.s-label(for="permissions") Permissions .s-select select#permissions(name="permissions") diff --git a/src/web/pug/log-in-with-matrix.pug b/src/web/pug/log-in-with-matrix.pug index 9853eaf..d9f4a59 100644 --- a/src/web/pug/log-in-with-matrix.pug +++ b/src/web/pug/log-in-with-matrix.pug @@ -11,6 +11,6 @@ block body input(type="hidden" name="next" value=next) .d-flex.gy4.fd-column label.s-label(for="mxid") Your Matrix ID - input.fl-grow1.s-input.wmx3#mxid(name="mxid" required placeholder="@user:example.org" pattern="@([^:]+):([a-z0-9:\-]+\.[a-z0-9.:\-]+)") + input.fl-grow1.s-input.wmx3#mxid(name="mxid" required placeholder="@user:example.org" pattern="@([^:]+):([a-z0-9:\\-]+\\.[a-z0-9.:\\-]+)") div button.s-btn.s-btn__github#log-in-button Continue with Matrix