aboutsummaryrefslogtreecommitdiffstats
path: root/include/import.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-12-07 11:49:25 -0800
committerzotlabs <mike@macgirvin.com>2017-12-07 11:49:25 -0800
commit979c05b24da0497be582aacaa8b744f692b56ccf (patch)
treeb311b0b398272ff4de778a72c12e748d2c15fa7c /include/import.php
parente5653945d35e00ae1821fa93e502cc4555519735 (diff)
parent3dac1a8d4ae6d087ff9bea6f194b76a37e34f938 (diff)
downloadvolse-hubzilla-979c05b24da0497be582aacaa8b744f692b56ccf.tar.gz
volse-hubzilla-979c05b24da0497be582aacaa8b744f692b56ccf.tar.bz2
volse-hubzilla-979c05b24da0497be582aacaa8b744f692b56ccf.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'include/import.php')
-rw-r--r--include/import.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/import.php b/include/import.php
index 8cab16342..cd7056497 100644
--- a/include/import.php
+++ b/include/import.php
@@ -1081,6 +1081,7 @@ function sync_files($channel, $files) {
logger('sync_files duplicate check: attach_by_hash() returned ' . print_r($x,true), LOGGER_DEBUG);
if($x['success']) {
+ $orig_attach = $x[0];
$attach_exists = true;
$attach_id = $x[0]['id'];
}
@@ -1145,12 +1146,18 @@ function sync_files($channel, $files) {
// If the hash ever contains any escapable chars this could cause
// problems. Currently it does not.
- /// @TODO implement os_path
if(!isset($att['os_path']))
$att['os_path'] = '';
if($attach_exists) {
logger('sync_files attach exists: ' . print_r($att,true), LOGGER_DEBUG);
+
+ // process/sync a remote rename/move operation
+
+ if($orig_attach['content'] !== $newfname) {
+ rename($orig_attach['content'],$newfname);
+ }
+
if(! dbesc_array($att))
continue;