diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/account.php | 2 | ||||
-rw-r--r-- | include/channel.php | 6 | ||||
-rw-r--r-- | include/import.php | 11 |
3 files changed, 10 insertions, 9 deletions
diff --git a/include/account.php b/include/account.php index a7a87f331..349c6cfee 100644 --- a/include/account.php +++ b/include/account.php @@ -1276,7 +1276,7 @@ function get_pending_accounts($get_all = false) { if($get_all) $sql_extra = ''; - $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id, reg_stuff + $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id, reg_flags, reg_stuff FROM register WHERE reg_vital = 1 $sql_extra AND (reg_flags & %d) >= 0", intval(ACCOUNT_PENDING) ); diff --git a/include/channel.php b/include/channel.php index ecb7c24f7..31c7c407f 100644 --- a/include/channel.php +++ b/include/channel.php @@ -922,7 +922,7 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals $ret['photo'] = [ 'type' => $r[0]['mimetype'], 'data' => (($r[0]['os_storage']) - ? base64url_encode(file_get_contents($r[0]['content'])) : base64url_encode(dbunescbin($r[0]['content']))) + ? base64url_encode(file_get_contents(dbunescbin($r[0]['content']))) : base64url_encode(dbunescbin($r[0]['content']))) ]; } } @@ -991,11 +991,11 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals } if($xchans) { - $r = q("select * from xchan where xchan_hash in ( " . implode(',',$xchans) . " ) "); + $r = dbq("select * from xchan where xchan_hash in ( " . implode(',',$xchans) . " ) "); if($r) $ret['xchan'] = $r; - $r = q("select * from hubloc where hubloc_hash in ( " . implode(',',$xchans) . " ) "); + $r = dbq("select * from hubloc where hubloc_hash in ( " . implode(',',$xchans) . " ) "); if($r) $ret['hubloc'] = $r; } diff --git a/include/import.php b/include/import.php index 8ce582ede..42fa2f247 100644 --- a/include/import.php +++ b/include/import.php @@ -708,12 +708,12 @@ function import_items($channel, $items, $sync = false, $relocate = null) { $allow_code = channel_codeallowed($channel['channel_id']); $deliver = false; // Don't deliver any messages or notifications when importing - foreach($items as $i) { $item_result = false; $item = get_item_elements($i,$allow_code); - if(! $item) + if(! $item) { continue; + } // deprecated @@ -724,9 +724,10 @@ function import_items($channel, $items, $sync = false, $relocate = null) { item_url_replace($channel,$item,$relocate['url'],z_root(),$relocate['channel_address']); } - $r = q("select id, edited from item where mid = '%s' and uid = %d limit 1", + $r = q("select id, edited from item where mid = '%s' and uid = %d and revision = %d limit 1", dbesc($item['mid']), - intval($channel['channel_id']) + intval($channel['channel_id']), + intval($item['revision']) ); if($r) { @@ -734,7 +735,7 @@ function import_items($channel, $items, $sync = false, $relocate = null) { // so force an update even if we have the same timestamp if($item['edited'] >= $r[0]['edited']) { - $item['id'] = $r[0]['id']; + $item['id'] = $r[0]['id']; $item['uid'] = $channel['channel_id']; $item_result = item_store_update($item,$allow_code,$deliver); } |