From 6f95c50d6ee41649c706b683805797f2630f1a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 6 Feb 2019 13:52:03 +0100 Subject: [PATCH] Revert "misc: make URL protocol matching regexes non-greedy" This reverts commit 7c911eca96a6034bc96276e0a491774df52bc2cd. I'm dumb. We need global mode because otherwise lastIndex is not updated in the regex object, which we rely upon, so this is intentional. --- react/features/base/util/uri.js | 2 +- react/features/deep-linking/functions.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react/features/base/util/uri.js b/react/features/base/util/uri.js index 31003e998..de9e9c4ea 100644 --- a/react/features/base/util/uri.js +++ b/react/features/base/util/uri.js @@ -71,7 +71,7 @@ function _fixRoom(room: ?string) { * @returns {string} */ function _fixURIStringScheme(uri: string) { - const regex = new RegExp(`${URI_PROTOCOL_PATTERN}+`, 'i'); + const regex = new RegExp(`${URI_PROTOCOL_PATTERN}+`, 'gi'); const match: Array | null = regex.exec(uri); if (match) { diff --git a/react/features/deep-linking/functions.js b/react/features/deep-linking/functions.js index 6f55b0166..0fe678cd0 100644 --- a/react/features/deep-linking/functions.js +++ b/react/features/deep-linking/functions.js @@ -45,7 +45,7 @@ export function generateDeepLinkingURL() { const appScheme = interfaceConfig.APP_SCHEME || 'org.jitsi.meet'; const { href } = window.location; - const regex = new RegExp(URI_PROTOCOL_PATTERN, 'i'); + const regex = new RegExp(URI_PROTOCOL_PATTERN, 'gi'); // Android: use an intent link, custom schemes don't work in all browsers. // https://developer.chrome.com/multidevice/android/intents