import/export issues

This commit is contained in:
nobody 2021-01-08 13:53:28 -08:00
parent 29042b8a6f
commit 9c65d28244
3 changed files with 10 additions and 7 deletions

View file

@ -10,10 +10,10 @@ class Uexport extends Controller {
if (! local_channel()) {
return;
}
if (argc() > 1) {
$sections = (($_REQUEST['sections']) ? explode(',',$_REQUEST['sections']) : '');
$sections = (($_REQUEST['sections']) ? explode(',',$_REQUEST['sections']) : get_default_export_sections());
if (argc() > 1) {
$channel = App::get_channel();
@ -28,20 +28,21 @@ 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 = ((version_compare(PHP_VERSION,'7.2.0') >= 0) ? JSON_INVALID_UTF8_SUBSTITUTE : 0);
if ($year) {
echo json_encode(identity_export_year(local_channel(),$year,$month));
echo json_encode(identity_export_year(local_channel(),$year,$month), $flags);
killme();
}
if (argc() > 1 && argv(1) === 'basic') {
echo json_encode(identity_basic_export(local_channel(),$sections));
echo json_encode(identity_basic_export(local_channel(),$sections), $flags);
killme();
}
// Warning: this option may consume a lot of memory
if(argc() > 1 && argv(1) === 'complete') {
$sections = get_default_export_sections();
$sections[] = 'items';
echo json_encode(identity_basic_export(local_channel(),$sections));
killme();

View file

@ -16,7 +16,7 @@ use Zotlabs\Daemon\Run;
* @brief This file defines some global constants and includes the central App class.
*/
define ( 'STD_VERSION', '20.12.24' );
define ( 'STD_VERSION', '21.01.09' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1247 );

View file

@ -2997,6 +2997,8 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
// $mention = '@[zrl=' . $item['author']['xchan_url'] . ']' . $item['author']['xchan_name'] . '[/zrl]';
$arr['body'] = $bb;
$arr['term'] = $item['term'];
$arr['author_xchan'] = $channel['channel_hash'];
$arr['owner_xchan'] = $channel['channel_hash'];