MOBILE-2567 login: Escape mail to avoid regexp compare
parent
b72cea5823
commit
558c22c3b3
|
@ -87,7 +87,7 @@
|
|||
</ion-item>
|
||||
<ion-item text-wrap>
|
||||
<ion-label stacked core-mark-required="true">{{ 'core.user.emailagain' | translate }}</ion-label>
|
||||
<ion-input type="email" name="email2" placeholder="{{ 'core.user.emailagain' | translate }}" formControlName="email2" autocapitalize="none" autocorrect="off" pattern="{{signupForm.controls.email.value}}"></ion-input>
|
||||
<ion-input type="email" name="email2" placeholder="{{ 'core.user.emailagain' | translate }}" formControlName="email2" autocapitalize="none" autocorrect="off" [pattern]="escapeMail(signupForm.controls.email.value)"></ion-input>
|
||||
<core-input-errors item-content [control]="signupForm.controls.email2" [errorMessages]="email2Errors"></core-input-errors>
|
||||
</ion-item>
|
||||
<ion-item *ngFor="let nameField of settings.namefields" text-wrap>
|
||||
|
|
|
@ -283,6 +283,16 @@ export class CoreLoginEmailSignupPage {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape mail to avoid special characters to be treated as a RegExp.
|
||||
*
|
||||
* @param {string} text Initial mail.
|
||||
* @return {string} Escaped mail.
|
||||
*/
|
||||
escapeMail(text: string): string {
|
||||
return this.textUtils.escapeForRegex(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show authentication instructions.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue