@forcecalendar/core 2.1.37 → 2.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/events/Event.js +3 -3
- package/package.json +1 -1
package/core/events/Event.js
CHANGED
|
@@ -148,8 +148,8 @@ export class Event {
|
|
|
148
148
|
if (!attendee.email || !attendee.name) {
|
|
149
149
|
throw new Error(`Attendee at index ${index} must have email and name`);
|
|
150
150
|
}
|
|
151
|
-
// Validate email format
|
|
152
|
-
const emailRegex = /^[^\s@]+@[^\s
|
|
151
|
+
// Validate email format (linear-time regex, no backtracking)
|
|
152
|
+
const emailRegex = /^[^\s@]+@[^\s@.]+\.[^\s@]+$/;
|
|
153
153
|
if (!emailRegex.test(attendee.email)) {
|
|
154
154
|
throw new Error(`Invalid email for attendee: ${attendee.email}`);
|
|
155
155
|
}
|
|
@@ -919,7 +919,7 @@ export class Event {
|
|
|
919
919
|
* @returns {boolean} True if email is valid
|
|
920
920
|
*/
|
|
921
921
|
_isValidEmail(email) {
|
|
922
|
-
const emailRegex = /^[^\s@]+@[^\s
|
|
922
|
+
const emailRegex = /^[^\s@]+@[^\s@.]+\.[^\s@]+$/;
|
|
923
923
|
return emailRegex.test(email);
|
|
924
924
|
}
|
|
925
925
|
|