Skip to content

Commit 92d2dc3

Browse files
committedJun 16, 2012
Fix #13415: cloning issue with attachments doesn't work
1 parent b63e181 commit 92d2dc3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎core/file_api.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -871,11 +871,12 @@ function file_copy_attachments( $p_source_bug_id, $p_dest_bug_id ) {
871871

872872
# prepare the new diskfile name and then copy the file
873873
$t_file_path = $t_bug_file['folder'];
874-
$t_new_diskfile_name = $t_file_path . file_generate_unique_name( 'bug-' . $t_bug_file['filename'], $t_file_path );
874+
$t_new_diskfile_name = file_generate_unique_name( 'bug-' . $t_bug_file['filename'], $t_file_path );
875+
$t_new_diskfile_location = $t_file_path . $t_new_diskfile_name;
875876
$t_new_file_name = file_get_display_name( $t_bug_file['filename'] );
876877
if(( config_get( 'file_upload_method' ) == DISK ) ) {
877-
copy( $t_file_path.$t_bug_file['diskfile'], $t_new_diskfile_name );
878-
chmod( $t_new_diskfile_name, config_get( 'attachments_file_permissions' ) );
878+
copy( $t_file_path.$t_bug_file['diskfile'], $t_new_diskfile_location );
879+
chmod( $t_new_diskfile_location, config_get( 'attachments_file_permissions' ) );
879880
}
880881

881882
$query = "INSERT INTO $t_mantis_bug_file_table

0 commit comments

Comments
 (0)
Please sign in to comment.