Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-2741

e-mail validation is not centralized, and wrong

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.2.0
    • 4.1.0
    • None
    • None
    • 4.1RC1
    • 4.2 M11

      In at least 8 classes in Ametys, there is an email validator regexp looking like

      ^([a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-zA-Z0-9]{2,})?$
      

      or

      ^([a-zA-Z0-9_\\.\\-\\+])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,})+$
      

      This should be centralized, and corrected.

      It is nearly impossible to really validate an email address, so a simple regex like

      .*@.*
      

      should be used instead.

      regexp found :

      • org.ametys.plugins.forms.processing.FormValidators.getEmailPattern()
      • org.ametys.cms.repository.comment.DefaultCommentManagerExtensionPoint.EMAIL_VALIDATOR
      • org.ametys.plugins.newsletter.subscribe.ImportSubscribersAction.__EMAIL_VALIDATOR
      • org.ametys.plugins.newsletter.subscribe.SubscribersClientSideElement.__EMAIL_VALIDATOR
      • org.ametys.plugins.pagesubscription.InfoSubscriberGenerator.EMAIL_VALIDATOR
      • org.ametys.plugins.pagesubscription.PageSubscribeAction.EMAIL_VALIDATOR
      • org.ametys.plugins.socialnetworking.SendMailAction.EMAIL_VALIDATOR
      • org.ametys.plugins.socialnetworking.SendMailAction.EMAIL_LIST_VALIDATOR

       

            Unassigned Unassigned
            pgros Pierre Gros (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: