mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:55:19 +00:00
cleanup export file disposition
This commit is contained in:
parent
c648458151
commit
92e2271268
1 changed files with 5 additions and 2 deletions
|
@ -34,20 +34,23 @@ class Uexport extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
header('content-type: application/json');
|
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;
|
$flags = JSON_INVALID_UTF8_SUBSTITUTE;
|
||||||
|
|
||||||
if (argc() > 1 && argv(1) === 'activitypub') {
|
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);
|
echo json_encode(Activity::actorEncode($channel, extended: true, activitypub: true, export: true, legacy: false), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc() > 1 && argv(1) === 'identity-key') {
|
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();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header('Content-Disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . (($month) ? '-' . $month : '') . (($_REQUEST['sections']) ? '-' . $_REQUEST['sections'] : '') . '.json"');
|
||||||
|
|
||||||
if ($year) {
|
if ($year) {
|
||||||
echo json_encode(Channel::export_year(local_channel(), $year, $month), $flags);
|
echo json_encode(Channel::export_year(local_channel(), $year, $month), $flags);
|
||||||
killme();
|
killme();
|
||||||
|
|
Loading…
Reference in a new issue