X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-text-utils.c;h=51e340ebde976d00b48e2ffeff5790010296a226;hp=da5859def7c787de3b136aebd023716181335411;hb=92bef44ea70f8b4e16c78591bc12f58fac9a7c53;hpb=048b382238390d0468241b324aecd0c668c19587 diff --git a/src/modest-text-utils.c b/src/modest-text-utils.c index da5859d..51e340e 100644 --- a/src/modest-text-utils.c +++ b/src/modest-text-utils.c @@ -248,9 +248,9 @@ modest_text_utils_derived_subject (const gchar *subject, const gchar *prefix) gchar *tmp; g_return_val_if_fail (prefix, NULL); - - if (!subject) - return g_strdup (prefix); + + if (!subject || subject[0] == '\0') + subject = _("mail_va_no_subject"); tmp = g_strchug (g_strdup (subject)); @@ -1114,7 +1114,6 @@ modest_text_utils_validate_folder_name (const gchar *folder_name) /* cannot contain a forbidden word */ if (len <= 4) { for (cursor = forbidden_names; cursor && *cursor; ++cursor) { - g_warning ("%s", *cursor); if (g_ascii_strcasecmp (folder_name, *cursor) == 0) return FALSE; } @@ -1158,7 +1157,14 @@ modest_text_utils_validate_email_address (const gchar *email_address, const gcha if (invalid_char_position != NULL) *invalid_char_position = NULL; - + + /* check that the email adress contains exactly one @ */ + if (!strstr(email_address, "@") || + (strstr(email_address, "@") != g_strrstr(email_address, "@"))) + { + return FALSE; + } + /* first we validate the name portion (name@domain) */ for (c = email_address; *c; c++) { if (*c == '\"' &&