aboutsummaryrefslogtreecommitdiffstats
path: root/include/import.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-01 21:48:54 -0700
committerredmatrix <git@macgirvin.com>2016-06-01 21:48:54 -0700
commita9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2 (patch)
treede0ac6910e13926df60cfed458e50310c5642055 /include/import.php
parentb1259876bf398880e7b0c1b44d90f94983243e72 (diff)
downloadvolse-hubzilla-a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2.tar.gz
volse-hubzilla-a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2.tar.bz2
volse-hubzilla-a9d7acda279ebb7f2b3cd61a91a5e1d8b590dcf2.zip
the rest of the schema updates - WARNING: some third party plugins may fail; e.g. embedphotos and chess. $item['object'] is now $item['obj'] and $photo['type'] is $photo['mimetype'], $photo['scale'] is $photo['imgscale'] and $photo['data'] is now $photo['content']. There are a number of other changes, but these are the ones noted to cause issues with third-party plugins. The project plugins have been updated. Please note any new issues as this effort touched a lot of code in a lot of files.
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'])
);