aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Content_importer.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Daemon/Content_importer.php')
-rw-r--r--Zotlabs/Daemon/Content_importer.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/Zotlabs/Daemon/Content_importer.php b/Zotlabs/Daemon/Content_importer.php
index 67f1c8e80..b98a1f10d 100644
--- a/Zotlabs/Daemon/Content_importer.php
+++ b/Zotlabs/Daemon/Content_importer.php
@@ -38,7 +38,13 @@ class Content_importer {
$headers = HTTPSig::create_sig($headers,$channel['channel_prvkey'], channel_url($channel),true,'sha512');
- $x = z_fetch_url($hz_server . '/api/z/1.0/item/export_page?f=&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page,false,$redirects,[ 'headers' => $headers ]);
+ $redirects = 0;
+ $x = z_fetch_url(
+ $hz_server . '/api/z/1.0/item/export_page?f=&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page,
+ false,
+ $redirects,
+ [ 'headers' => $headers ]
+ );
// logger('item fetch: ' . print_r($x,true));
@@ -47,9 +53,9 @@ class Content_importer {
killme();
}
- $j = json_decode($x['body'],true);
+ $j = json_decode($x['body'], true);
- if(! is_array($j['item']) || ! count($j['item'])) {
+ if($j && empty($j['item'])) {
PConfig::Set($channel['channel_id'], 'import', 'content_completed', 1);
return;
}