]> git.mxchange.org Git - friendica.git/commitdiff
Prevent empty fields on contact export via CSV
authorMichael <heluecht@pirati.ca>
Sun, 27 Sep 2020 10:27:31 +0000 (10:27 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 27 Sep 2020 10:27:31 +0000 (10:27 +0000)
src/Module/Settings/UserExport.php

index c70662f39a818d2de31539d85dc731ade6c68996..25e305e42387afe64dce6e00d4576c6cb533b179 100644 (file)
@@ -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);
        }