From 576bfedfb54e5625bcda2b976b1ca62aadfb0e11 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 13 Dec 2018 22:00:06 -0700 Subject: [PATCH] Remove global flag Regular expression objects are stateful, and the global flag interferes badly with the expression. A valid call can cause it to act like a flip flop instead of a stateless test. --- src/Registration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Registration.js b/src/Registration.js index 8364fc7cdb..98aee3ac83 100644 --- a/src/Registration.js +++ b/src/Registration.js @@ -28,7 +28,7 @@ import { _t } from './languageHandler'; // Regex for what a "safe" or "Matrix-looking" localpart would be. // TODO: Update as needed for https://github.com/matrix-org/matrix-doc/issues/1514 -export const SAFE_LOCALPART_REGEX = /^[a-z0-9=_\-./]+$/g; +export const SAFE_LOCALPART_REGEX = /^[a-z0-9=_\-./]+$/; /** * Starts either the ILAG or full registration flow, depending