@@ -668,7 +668,7 @@ function file_add( $p_bug_id, $p_file, $p_table = 'bug', $p_title = '', $p_desc
668
668
$ t_file_path = config_get ( 'absolute_path_default_upload_folder ' );
669
669
} else {
670
670
$ t_file_path = project_get_field ( $ t_project_id , 'file_path ' );
671
- if ( $ t_file_path == '' ) {
671
+ if ( is_blank ( $ t_file_path ) ) {
672
672
$ t_file_path = config_get ( 'absolute_path_default_upload_folder ' );
673
673
}
674
674
}
@@ -1019,26 +1019,26 @@ function file_move_bug_attachments( $p_bug_id, $p_project_id_to ) {
1019
1019
}
1020
1020
1021
1021
/**
1022
- *
1022
+ *
1023
1023
* Copies all attachments from the source bug to the destination bug
1024
- *
1024
+ *
1025
1025
* <p>Does not perform history logging and does not perform access checks.</p>
1026
- *
1026
+ *
1027
1027
* @param int $p_source_bug_id
1028
1028
* @param int $p_dest_bug_id
1029
1029
*/
1030
1030
function file_copy_attachments ( $ p_source_bug_id , $ p_dest_bug_id ) {
1031
-
1031
+
1032
1032
$ t_mantis_bug_file_table = db_get_table ( 'bug_file ' );
1033
-
1033
+
1034
1034
$ query = 'SELECT * FROM ' . $ t_mantis_bug_file_table . ' WHERE bug_id = ' . db_param ();
1035
1035
$ result = db_query_bound ( $ query , Array ( $ p_source_bug_id ) );
1036
1036
$ t_count = db_num_rows ( $ result );
1037
-
1037
+
1038
1038
$ t_bug_file = array ();
1039
1039
for ( $ i = 0 ;$ i < $ t_count ;$ i ++ ) {
1040
1040
$ t_bug_file = db_fetch_array ( $ result );
1041
-
1041
+
1042
1042
# prepare the new diskfile name and then copy the file
1043
1043
$ t_file_path = dirname ( $ t_bug_file ['folder ' ] );
1044
1044
$ t_new_diskfile_name = $ t_file_path . file_generate_unique_name ( 'bug- ' . $ t_bug_file ['filename ' ], $ t_file_path );
@@ -1047,7 +1047,7 @@ function file_copy_attachments( $p_source_bug_id, $p_dest_bug_id ) {
1047
1047
copy ( $ t_bug_file ['diskfile ' ], $ t_new_diskfile_name );
1048
1048
chmod ( $ t_new_diskfile_name , config_get ( 'attachments_file_permissions ' ) );
1049
1049
}
1050
-
1050
+
1051
1051
$ query = "INSERT INTO $ t_mantis_bug_file_table
1052
1052
( bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content )
1053
1053
VALUES ( " . db_param () . ",
0 commit comments