Permalink
Browse files

Fix #13415 ( cloning issue with attachments doesn't work )

Thanks to adminactoll for providing the patch.
  • Loading branch information...
1 parent c2746c5 commit 0b8298ecdc9902cf7a3fbb68994ff5e0fa20d4ad @rombert rombert committed Nov 14, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/file_api.php
View
@@ -870,11 +870,11 @@ function file_copy_attachments( $p_source_bug_id, $p_dest_bug_id ) {
$t_bug_file = db_fetch_array( $result );
# prepare the new diskfile name and then copy the file
- $t_file_path = dirname( $t_bug_file['folder'] );
+ $t_file_path = $t_bug_file['folder'];
$t_new_diskfile_name = $t_file_path . file_generate_unique_name( 'bug-' . $t_bug_file['filename'], $t_file_path );
$t_new_file_name = file_get_display_name( $t_bug_file['filename'] );
if(( config_get( 'file_upload_method' ) == DISK ) ) {
- copy( $t_bug_file['diskfile'], $t_new_diskfile_name );
+ copy( $t_file_path.$t_bug_file['diskfile'], $t_new_diskfile_name );
chmod( $t_new_diskfile_name, config_get( 'attachments_file_permissions' ) );
}

0 comments on commit 0b8298e

Please sign in to comment.