Phone number check algorithm has holes
Description
Activity

Cynthia WilburnMarch 12, 2012 at 2:19 PM
Reopening to add 6.1.1 CE GA2. Close as Fixed.

Manuel de la PeñaJanuary 24, 2012 at 2:21 AM
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.

Juan FernándezMay 10, 2010 at 4:15 AM
This method has been developed on pourpose to behave like that

Juan FernándezMay 4, 2010 at 1:50 AM
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
Details
Assignee
Michael SaechangMichael Saechang(Deactivated)Reporter
Michael SaechangMichael Saechang(Deactivated)Labels
Branch Version/s
6.1.xBackported to Branch
CommittedGit Pull Request
Components
Fix versions
Priority
Medium
Details
Details
Assignee

Reporter

Labels
Branch Version/s
Backported to Branch
Git Pull Request
Components
Fix versions
Priority
Zendesk Support
Linked Tickets
Zendesk Support
Linked Tickets
Zendesk Support

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.