Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Similar Issues:
      Show 4 results 

      Description

      1. Create one user, and add him to be the friend of the default user--admin.
      2. Now go to Contacts portlet, and click on the icon which will leads you to add contact info.
      3. Now fill in the following in the phone-number-inputbox, "123232aadsfa" and "asdfasdfa", and you would see different result. Using the pure letter string, you would get the error message, but using the first one, you would get these letters got deleted directly without giving any warning message.

        Issue Links

          Activity

          Hide
          Juan Fernández added a comment -

          Hi Michael:
          in PhoneLocalServiceImpl, lines 116 & 117, there are two calls to the PhoneNumberUtil.strip(number) method.
          This is coded to do what you camplaint about. So this issue can be fixed just removing those two lines.
          The point is that they're there because somebody thought it was needed for some reason... can you think a use case where this is necessary so that we can't delete those lines?
          Thanks
          Juan Fernández

          Show
          Juan Fernández added a comment - Hi Michael: in PhoneLocalServiceImpl, lines 116 & 117, there are two calls to the PhoneNumberUtil.strip(number) method. This is coded to do what you camplaint about. So this issue can be fixed just removing those two lines. The point is that they're there because somebody thought it was needed for some reason... can you think a use case where this is necessary so that we can't delete those lines? Thanks Juan Fernández
          Hide
          Juan Fernández added a comment -

          This method has been developed on pourpose to behave like that

          Show
          Juan Fernández added a comment - This method has been developed on pourpose to behave like that
          Hide
          Manuel de la Peña added a comment -

          Phone number should be validated in a stronger way:

          1) Is not null
          2) Check type of PhoneFormat
          2.1) if USAPhoneFormat: check alphanumeric, strip
          2.2) else: check all characters are digits, don't strip

          I suggest improving architecture, adding validateNumber(String) method to com.liferay.util.format.PhoneNumberFormat.

          Then, I'd create a GenericPhoneNumberFormat implementing that interface, and modifying other implementations (USAPhoneNumberFormat and IdenticalPhoneNumberFormat) to include the new method.

          com.liferay.util.format.PhoneNumberUtil also should include a new method to validate the number.

          Show
          Manuel de la Peña added a comment - Phone number should be validated in a stronger way: 1) Is not null 2) Check type of PhoneFormat 2.1) if USAPhoneFormat: check alphanumeric, strip 2.2) else: check all characters are digits, don't strip I suggest improving architecture, adding validateNumber(String) method to com.liferay.util.format.PhoneNumberFormat. Then, I'd create a GenericPhoneNumberFormat implementing that interface, and modifying other implementations (USAPhoneNumberFormat and IdenticalPhoneNumberFormat) to include the new method. com.liferay.util.format.PhoneNumberUtil also should include a new method to validate the number.
          Hide
          Cynthia Wilburn (Inactive) added a comment -

          Reopening to add 6.1.1 CE GA2. Close as Fixed.

          Show
          Cynthia Wilburn (Inactive) added a comment - Reopening to add 6.1.1 CE GA2. Close as Fixed.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 25 weeks ago

                Development

                  Structure Helper Panel