Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alex Skrypnyk 6182 posts 24284 karma points MVP 9x admin c-trib
    Sep 18, 2018 @ 12:21
    Alex Skrypnyk
    0

    MembershipHelper.RegisterMember returns Invalid email for email with one letter domain

    In Umbraco 7.2.1MembershipHelper.RegisterMember returns Invalid email for an email with one letter domain, example "test@i.com".

    "test@i.com" is totally valid email. Is it possible to fix it?

    Thanks,

    Alex

  • Kevin Jump 2348 posts 14896 karma points MVP 9x c-trib
    Sep 20, 2018 @ 15:43
    Kevin Jump
    100

    Hi Alex,

    the actual MembershipHelper and MembershipProvider work with one letter domains if uses directly.

    I think the problem is with the registration model used by the 'CreateRegistrationModel' function that has a lovely bit of RegEx on the email address ,which is i suspect where the problem lies, (see https://github.com/umbraco/Umbraco-CMS/blob/8c815554da8905bc205219465ada6f8d40667173/src/Umbraco.Web/Models/RegisterModel.cs#L50)

    If you roll your own Model and Registration controller - Then the underling services are fine. (they use System.ComponentModel.DataAnnotations - which is a simple check for an @ sign nonot at the begginging as far as i can tell https://github.com/Microsoft/referencesource/blob/master/System.ComponentModel.DataAnnotations/DataAnnotations/EmailAddressAttribute.cs)

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 9x admin c-trib
    Sep 24, 2018 @ 20:27
    Alex Skrypnyk
    0

    Thanks, Kevin, just fixed the issue

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies