Mercurial > pidgin.yaz
comparison src/account.c @ 5610:4a1f97312412
[gaim-migrate @ 6016]
properly escape things in accounts.xml
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 31 May 2003 16:12:09 +0000 |
parents | 3a9b54f260e3 |
children | c9724982ce45 |
comparison
equal
deleted
inserted
replaced
5609:eaf058fc47a5 | 5610:4a1f97312412 |
---|---|
706 static void | 706 static void |
707 gaim_accounts_write(FILE *fp, GaimAccount *account) | 707 gaim_accounts_write(FILE *fp, GaimAccount *account) |
708 { | 708 { |
709 GaimPlugin *plugin; | 709 GaimPlugin *plugin; |
710 const char *password, *alias, *user_info, *buddy_icon; | 710 const char *password, *alias, *user_info, *buddy_icon; |
711 char *esc; | |
711 | 712 |
712 plugin = gaim_find_prpl(gaim_account_get_protocol(account)); | 713 plugin = gaim_find_prpl(gaim_account_get_protocol(account)); |
713 | 714 |
714 fprintf(fp, " <account>\n"); | 715 fprintf(fp, " <account>\n"); |
715 fprintf(fp, " <protocol>%s</protocol>\n", | 716 fprintf(fp, " <protocol>%s</protocol>\n", |
716 (plugin != NULL && plugin->info != NULL && plugin->info->id != NULL | 717 (plugin != NULL && plugin->info != NULL && plugin->info->id != NULL |
717 ? plugin->info->id : "unknown")); | 718 ? plugin->info->id : "unknown")); |
718 fprintf(fp, " <name>%s</name>\n", gaim_account_get_username(account)); | 719 esc = g_markup_escape_text(gaim_account_get_username(account), -1); |
720 fprintf(fp, " <name>%s</name>\n", esc); | |
721 g_free(esc); | |
719 | 722 |
720 if (gaim_account_get_remember_password(account) && | 723 if (gaim_account_get_remember_password(account) && |
721 (password = gaim_account_get_password(account)) != NULL) { | 724 (password = gaim_account_get_password(account)) != NULL) { |
722 | 725 esc = g_markup_escape_text(password, -1); |
723 fprintf(fp, " <password>%s</password>\n", password); | 726 fprintf(fp, " <password>%s</password>\n", esc); |
724 } | 727 g_free(esc); |
725 | 728 } |
726 if ((alias = gaim_account_get_alias(account)) != NULL) | 729 |
727 fprintf(fp, " <alias>%s</alias>\n", alias); | 730 if ((alias = gaim_account_get_alias(account)) != NULL) { |
728 | 731 esc = g_markup_escape_text(alias, -1); |
729 if ((user_info = gaim_account_get_user_info(account)) != NULL) | 732 fprintf(fp, " <alias>%s</alias>\n", esc); |
730 fprintf(fp, " <userinfo>%s</userinfo>\n", user_info); | 733 g_free(esc); |
731 | 734 } |
732 if ((buddy_icon = gaim_account_get_buddy_icon(account)) != NULL) | 735 |
733 fprintf(fp, " <buddyicon>%s</buddyicon>\n", buddy_icon); | 736 if ((user_info = gaim_account_get_user_info(account)) != NULL) { |
737 esc = g_markup_escape_text(user_info, -1); | |
738 fprintf(fp, " <userinfo>%s</userinfo>\n", esc); | |
739 g_free(esc); | |
740 } | |
741 | |
742 if ((buddy_icon = gaim_account_get_buddy_icon(account)) != NULL) { | |
743 esc = g_markup_escape_text(buddy_icon, -1); | |
744 fprintf(fp, " <buddyicon>%s</buddyicon>\n", esc); | |
745 g_free(esc); | |
746 } | |
734 | 747 |
735 fprintf(fp, " <settings>\n"); | 748 fprintf(fp, " <settings>\n"); |
736 g_hash_table_foreach(account->settings, __write_setting, fp); | 749 g_hash_table_foreach(account->settings, __write_setting, fp); |
737 fprintf(fp, " </settings>\n"); | 750 fprintf(fp, " </settings>\n"); |
738 | 751 |