diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-08-24 20:18:18 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-08-24 20:18:18 +0200 |
commit | cdccf601320ec7e59f5d96438edac34d5ea30085 (patch) | |
tree | d08cdd7e50dca5fbbffa96d922536db745bc0233 /include/attach.php | |
parent | df2725a360f173d7521d8a552608014968763288 (diff) | |
parent | 85f24c292f071b9a83aea0aa122231afd57e7f73 (diff) | |
download | volse-hubzilla-cdccf601320ec7e59f5d96438edac34d5ea30085.tar.gz volse-hubzilla-cdccf601320ec7e59f5d96438edac34d5ea30085.tar.bz2 volse-hubzilla-cdccf601320ec7e59f5d96438edac34d5ea30085.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/attach.php')
-rw-r--r-- | include/attach.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/attach.php b/include/attach.php index 79a38590b..78e133b03 100644 --- a/include/attach.php +++ b/include/attach.php @@ -460,6 +460,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { // By default remove $src when finished $remove_when_processed = true; + $import_replace = false; if($options === 'import') { $src = $arr['src']; @@ -476,6 +477,9 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { if($arr['preserve_original']) $remove_when_processed = false; + if($arr['replace']) + $import_replace = true; + // if importing a directory, just do it now and go home - we're done. if(array_key_exists('is_dir',$arr) && intval($arr['is_dir'])) { @@ -617,8 +621,10 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { dbesc($folder_hash) ); if($r) { - $overwrite = get_pconfig($channel_id,'system','overwrite_dup_files'); + $overwrite = (($import_replace || get_pconfig($channel_id,'system','overwrite_dup_files')) ? true : false); if(($overwrite) || ($options === 'import')) { + if(! array_key_exists('edited',$arr)) + $arr['edited'] = datetime_convert(); $options = 'replace'; $existing_id = $x[0]['id']; $existing_size = intval($x[0]['filesize']); |