diff --git a/src/Module/Uexport.php b/src/Module/Uexport.php index 823f3d48c..09e2210ca 100644 --- a/src/Module/Uexport.php +++ b/src/Module/Uexport.php @@ -34,20 +34,23 @@ class Uexport extends Controller } header('content-type: application/json'); - header('Content-Disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . (($month) ? '-' . $month : '') . (($_REQUEST['sections']) ? '-' . $_REQUEST['sections'] : '') . '.json"'); $flags = JSON_INVALID_UTF8_SUBSTITUTE; if (argc() > 1 && argv(1) === 'activitypub') { + header('Content-Disposition: attachment; filename="' . $channel['channel_address'] . '.did' . '.json"'); echo json_encode(Activity::actorEncode($channel, extended: true, activitypub: true, export: true, legacy: false), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); killme(); } if (argc() > 1 && argv(1) === 'identity-key') { - echo (new Multibase())->secretKey($channel['channel_eprvkey']); + header('Content-Disposition: attachment; filename="' . $channel['channel_address'] . '.identity-key.txt"'); + echo json_encode([ 'privateKeyMultibase' => (new Multibase())->secretKey($channel['channel_eprvkey'])], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); killme(); } + header('Content-Disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . (($month) ? '-' . $month : '') . (($_REQUEST['sections']) ? '-' . $_REQUEST['sections'] : '') . '.json"'); + if ($year) { echo json_encode(Channel::export_year(local_channel(), $year, $month), $flags); killme();