Skip to content

Commit d8b2150

Browse files
committedJun 16, 2012
Fix #13415: cloning issue with attachments doesn't work
1 parent 7beac56 commit d8b2150

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
@@ -1041,11 +1041,12 @@ function file_copy_attachments( $p_source_bug_id, $p_dest_bug_id ) {
10411041

10421042
# prepare the new diskfile name and then copy the file
10431043
$t_file_path = $t_bug_file['folder'];
1044-
$t_new_diskfile_name = $t_file_path . file_generate_unique_name( 'bug-' . $t_bug_file['filename'], $t_file_path );
1044+
$t_new_diskfile_name = file_generate_unique_name( 'bug-' . $t_bug_file['filename'], $t_file_path );
1045+
$t_new_diskfile_location = $t_file_path . $t_new_diskfile_name;
10451046
$t_new_file_name = file_get_display_name( $t_bug_file['filename'] );
10461047
if(( config_get( 'file_upload_method' ) == DISK ) ) {
1047-
copy( $t_file_path.$t_bug_file['diskfile'], $t_new_diskfile_name );
1048-
chmod( $t_new_diskfile_name, config_get( 'attachments_file_permissions' ) );
1048+
copy( $t_file_path.$t_bug_file['diskfile'], $t_new_diskfile_location );
1049+
chmod( $t_new_diskfile_location, config_get( 'attachments_file_permissions' ) );
10491050
}
10501051

10511052
$query = "INSERT INTO $t_mantis_bug_file_table

0 commit comments

Comments
 (0)