From 845ab4b76420845dc9f625b8cd5f79a28e0c5ce4 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 27 Sep 2020 10:27:31 +0000 Subject: [PATCH] Prevent empty fields on contact export via CSV --- src/Module/Settings/UserExport.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php index c70662f39a..25e305e423 100644 --- a/src/Module/Settings/UserExport.php +++ b/src/Module/Settings/UserExport.php @@ -169,9 +169,9 @@ class UserExport extends BaseSettings // write the table header (like Mastodon) echo "Account address, Show boosts\n"; // get all the contacts - $contacts = DBA::select('contact', ['addr'], ['uid' => $_SESSION['uid'], 'self' => false, 'rel' => [1,3], 'deleted' => false]); + $contacts = DBA::select('contact', ['addr', 'url'], ['uid' => $_SESSION['uid'], 'self' => false, 'rel' => [1,3], 'deleted' => false]); while ($contact = DBA::fetch($contacts)) { - echo $contact['addr'] . ", true\n"; + echo ($contact['addr'] ? $contact['addr'] : $contact['url']) . ", true\n"; } DBA::close($contacts); }