Skip to content

Commit

Permalink
Remove duplicate error code and message
Browse files Browse the repository at this point in the history
There were two separate error constants defined, ERROR_DUPLICATE_FILE
and ERROR_FILE_DUPLICATE, corresponding to an error message string with
identical text.

This commit removes the redundant constant ERROR_DUPLICATE_FILE and the
corresponding error message.

Fixes #5228

Conflicts:

	lang/strings_english.txt
  • Loading branch information
dregad authored and rombert committed Mar 25, 2012
1 parent 6f5b3df commit 9b43e69
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion core/constant_inc.php
Expand Up @@ -214,7 +214,6 @@
define( 'ERROR_NO_FILE_SPECIFIED', 4 );
define( 'ERROR_FILE_DISALLOWED', 5 );
define( 'ERROR_NO_DIRECTORY', 6 );
define( 'ERROR_DUPLICATE_FILE', 9 );
define( 'ERROR_DUPLICATE_PROJECT', 10 );
define( 'ERROR_EMPTY_FIELD', 11 );
define( 'ERROR_PROTECTED_ACCOUNT', 12 );
Expand Down
4 changes: 2 additions & 2 deletions core/file_api.php
Expand Up @@ -640,7 +640,7 @@ function file_add( $p_bug_id, $p_file, $p_table = 'bug', $p_title = '', $p_desc
}

if( !file_is_name_unique( $t_file_name, $p_bug_id ) ) {
trigger_error( ERROR_DUPLICATE_FILE, ERROR );
trigger_error( ERROR_FILE_DUPLICATE, ERROR );
}

if( 'bug' == $p_table ) {
Expand Down Expand Up @@ -1077,4 +1077,4 @@ function file_get_content_type_override( $p_filename ) {
$t_extension = pathinfo( $p_filename, PATHINFO_EXTENSION );

return $g_file_download_content_type_overrides[$t_extension];
}
}
1 change: 0 additions & 1 deletion lang/strings_english.txt
Expand Up @@ -1508,7 +1508,6 @@ If you requested this verification, visit the following URL to change your passw
ERROR_NO_FILE_SPECIFIED => 'No file specified.',
ERROR_FILE_DISALLOWED => 'The file type is disallowed.',
ERROR_NO_DIRECTORY => 'The directory does not exist. Please check the project settings.',
ERROR_DUPLICATE_FILE => 'This is a duplicate file. Please delete the file first.',
ERROR_DUPLICATE_PROJECT => 'A project with that name already exists.',
ERROR_EMPTY_FIELD => 'A necessary field "%1$s" was empty. Please recheck your inputs.',
ERROR_PROTECTED_ACCOUNT => 'This account is protected. You are not allowed to access this until the account protection is lifted.',
Expand Down

0 comments on commit 9b43e69

Please sign in to comment.