Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

code review changes

Tudor-Ovidiu Avramf99c91941646
diff --git a/react/features/invite/constants.js b/react/features/invite/constants.js
index d894f34da8..b73aeed23b 100644
--- a/react/features/invite/constants.js
+++ b/react/features/invite/constants.js
@@ -44,7 +44,7 @@ export const OUTGOING_CALL_RINGING_SOUND_ID = 'OUTGOING_CALL_RINGING_SOUND_ID';
export const OUTGOING_CALL_START_SOUND_ID = 'OUTGOING_CALL_START_SOUND_ID';
/**
- * Regex for matching email addresses.
+ * Regex for matching sip addresses.
*/
// eslint-disable-next-line max-len
-export const EMAIL_ADDRESS_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
+export const SIP_ADDRESS_REGEX = /^[a-zA-Z]+(?:([^\s>:@]+)(?::([^\s@>]+))?@)?([\w\-.]+)(?::(\d+))?((?:;[^\s=?>;]+(?:=[^\s?;]+)?)*)(?:\?(([^\s&=>]+=[^\s&=>]+)(&[^\s&=>]+=[^\s&=>]+)*))?$/;
diff --git a/react/features/invite/functions.js b/react/features/invite/functions.js
index 26954a646c..83dd3c38ac 100644
--- a/react/features/invite/functions.js
+++ b/react/features/invite/functions.js
@@ -10,7 +10,7 @@ import { toState } from '../base/redux';
import { doGetJSON, parseURIString } from '../base/util';
import { isVpaasMeeting } from '../billing-counter/functions';
-import { EMAIL_ADDRESS_REGEX } from './constants';
+import { SIP_ADDRESS_REGEX } from './constants';
import logger from './logger';
declare var $: Function;
@@ -428,7 +428,7 @@ function isMaybeAPhoneNumber(text: string): boolean {
* @returns {boolean} True if provided text matches a sip address format.
*/
function isASipAddress(text: string): boolean {
- return EMAIL_ADDRESS_REGEX.test(text);
+ return SIP_ADDRESS_REGEX.test(text);
}
/**
@@ -807,7 +807,7 @@ export function isSharingEnabled(sharingFeature: string) {
/**
* Sends a post request to an invite service.
*
- * @param {Immutable.List} inviteItems - The list of the "sip" type items to invite.
+ * @param {Array} inviteItems - The list of the "sip" type items to invite.
* @param {string} sipInviteUrl - The invite service that generates the invitation.
* @param {string} jwt - The jwt token.
* @param {string} roomName - The name to the conference.