Prevent leading and trailing spaces on user's Full Name

On the Contact Information form it is possible for the user to
enter a Full Name that includes leading and/or trailing spaces,
for example:

  "      Firstname Surname"
  "Firstname Surname      "
  "   Firstname Surname   "

Or even a name that consists entirely of spaces:

  "                       "

The entered name is unchecked and will be saved to the database
as is.

Strip off the leading and trailing spaces before saving, and
refresh the entry field to make sure it displays the value that
was actually saved.

Change-Id: Ib058ae8f6ac6ec897f744a7cd017f268fe2da47f
This commit is contained in:
David Pursehouse
2012-12-05 11:33:25 +09:00
parent bbb8549dd5
commit 77516310a6
2 changed files with 2 additions and 1 deletions

View File

@@ -169,7 +169,7 @@ public final class Account {
/** Set the full name of the user ("Given-name Surname" style). */
public void setFullName(final String name) {
fullName = name;
fullName = name != null ? name.trim() : null;
}
/** Email address the user prefers to be contacted through. */