Users: strip out periods when generating proposals
Some systems seem to disallow them in usernames, but more importantly, the proposals look just wrong for abbreviated middle initials with a period. https://bugzilla.gnome.org/show_bug.cgi?id=650777
This commit is contained in:
parent
f50f66f345
commit
13a08f4994
1 changed files with 7 additions and 3 deletions
|
@ -557,14 +557,18 @@ generate_username_choices (const gchar *name,
|
||||||
|
|
||||||
lc_name = g_ascii_strdown (ascii_name, -1);
|
lc_name = g_ascii_strdown (ascii_name, -1);
|
||||||
|
|
||||||
/* remove all non ASCII alphanumeric chars from the name,
|
/* Remove all non ASCII alphanumeric chars from the name,
|
||||||
* apart from the few allowed symbols
|
* apart from the few allowed symbols.
|
||||||
|
*
|
||||||
|
* We do remove '.', even though it is usually allowed,
|
||||||
|
* since it often comes in via an abbreviated middle name,
|
||||||
|
* and the dot looks just wrong in the proposals then.
|
||||||
*/
|
*/
|
||||||
stripped_name = g_strnfill (strlen (lc_name) + 1, '\0');
|
stripped_name = g_strnfill (strlen (lc_name) + 1, '\0');
|
||||||
i = 0;
|
i = 0;
|
||||||
for (c = lc_name; *c; c++) {
|
for (c = lc_name; *c; c++) {
|
||||||
if (!(g_ascii_isdigit (*c) || g_ascii_islower (*c) ||
|
if (!(g_ascii_isdigit (*c) || g_ascii_islower (*c) ||
|
||||||
*c == ' ' || *c == '-' || *c == '.' || *c == '_' ||
|
*c == ' ' || *c == '-' || *c == '_' ||
|
||||||
/* used to track invalid words, removed below */
|
/* used to track invalid words, removed below */
|
||||||
*c == '?') )
|
*c == '?') )
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue