projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93fe5d6
)
CRM-17432 Attachment API create: use copy/unlink instead of rename(), to avoid file...
author
Mathieu Lutfy
<mathieu@bidon.ca>
Thu, 22 Oct 2015 18:00:59 +0000
(14:00 -0400)
committer
Mathieu Lutfy
<mathieu@bidon.ca>
Thu, 22 Oct 2015 18:00:59 +0000
(14:00 -0400)
api/v3/Attachment.php
patch
|
blob
|
blame
|
history
diff --git
a/api/v3/Attachment.php
b/api/v3/Attachment.php
index e8917eb4836e51c8fbd62f92d1e27fdb29fce4c3..1ae66b2651f3df12fda3baad43ce3e7a6f543b4f 100644
(file)
--- a/
api/v3/Attachment.php
+++ b/
api/v3/Attachment.php
@@
-160,7
+160,10
@@
function civicrm_api3_attachment_create($params) {
file_put_contents($path, $content);
}
elseif (is_string($moveFile)) {
- rename($moveFile, $path);
+ // CRM-17432 Do not use rename() since it will break file permissions.
+ // Also avoid move_uplaoded_file() because the API can use options.move-file.
+ copy($moveFile, $path);
+ unlink($moveFile);
}
// Save custom field to entity