aboutsummaryrefslogtreecommitdiffstats
path: root/include/import.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/import.php')
-rw-r--r--include/import.php26
1 files changed, 20 insertions, 6 deletions
diff --git a/include/import.php b/include/import.php
index d094fb582..6fcb08416 100644
--- a/include/import.php
+++ b/include/import.php
@@ -974,6 +974,11 @@ function sync_files($channel,$files) {
$attachment_stored = false;
foreach($f['attach'] as $att) {
+ if(array_key_exists('data',$att)) {
+ $att['content'] = $att['data'];
+ unset($att['data']);
+ }
+
if($att['deleted']) {
attach_delete($channel,$att['hash']);
continue;
@@ -1043,7 +1048,7 @@ function sync_files($channel,$files) {
// @fixme - update attachment structures if they are modified rather than created
- $att['data'] = $newfname;
+ $att['content'] = $newfname;
// Note: we use $att['hash'] below after it has been escaped to
// fetch the file contents.
@@ -1125,6 +1130,15 @@ function sync_files($channel,$files) {
$p['aid'] = $channel['channel_account_id'];
$p['uid'] = $channel['channel_id'];
+ if(array_key_exists('data',$p)) {
+ $p['content'] = $p['data'];
+ unset($p['data']);
+ }
+ if(array_key_exists('scale',$p)) {
+ $p['imgscale'] = $p['scale'];
+ unset($p['scale']);
+ }
+
// if this is a profile photo, undo the profile photo bit
// for any other photo which previously held it.
@@ -1150,15 +1164,15 @@ function sync_files($channel,$files) {
);
}
- if($p['scale'] === 0 && $p['os_storage'])
- $p['data'] = $store_path;
+ if($p['imgscale'] === 0 && $p['os_storage'])
+ $p['content'] = $store_path;
else
- $p['data'] = base64_decode($p['data']);
+ $p['content'] = base64_decode($p['content']);
- $exists = q("select * from photo where resource_id = '%s' and scale = %d and uid = %d limit 1",
+ $exists = q("select * from photo where resource_id = '%s' and imgscale = %d and uid = %d limit 1",
dbesc($p['resource_id']),
- intval($p['scale']),
+ intval($p['imgscale']),
intval($channel['channel_id'])
);