Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-119650

MustComplyWithRegex should not try to String.format a regex

    Details

      Description

      Reproduction steps

      1. Go into Control Panel > Users > Password Policy
      2. Edit the Default Password Policy, set the following Regexp

      ^((?=.*?[a-z])(?=.*?\d)(?=.*?[;~!@ #$%^&*_\-+=`|\\(){}\[\]:;\"'<>,.?/])|(?=.*?[A-Z])(?=.*?\d)(?=.*?[;~!@ #$%^&*_\-+=`|\\(){}\[\]:;\"'<>,.?/])|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[;~!@ #$%^&*_\-+=`|\\(){}\[\]:;\"'<>,.?/])|(?=.*?[A-Z])(?=.*?[a-z])(?=.*?\d)).{12,24}$
      

      3. Change the password of a user to e.g. Habanero0*# and save

      Expected result: Human readable error message on the UI

      Actual result: Exception in the logs

      2020-08-24 11:33:24.441 ERROR [http-nio-8080-exec-3][PortletServlet:112] javax.portlet.PortletException: java.util.UnknownFormatConversionException: Conversion = '^'
      javax.portlet.PortletException: java.util.UnknownFormatConversionException: Conversion = '^'

      Root cause:

      MustComplyWithRegex tries to String.format the regex, which has a (from Formatter perspective invalid) %^. 

        Attachments

          Activity

            People

            Assignee:
            sharry.shi Sharry Shi
            Reporter:
            balazs.safrany-kovalik Balázs Sáfrány-Kovalik
            Participants of an Issue:
            Recent user:
            Yunlin "Steven" Sun
            Engineering Assignee:
            Attila Bakay
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              32 weeks, 2 days ago

                Packages

                Version Package
                7.1.10 DXP FP20
                7.1.10.5 SP5
                7.1.X
                7.2.10 DXP FP9
                7.2.X
                7.3.X
                7.3.5 CE GA6
                7.3.10 DXP GA1
                Master