Skip to content

Commit

Permalink
Fix #0007118 Attaching an oversized file raises wrong error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Sep 28, 2014
1 parent 7603c7b commit 7ad9386
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bug_report.php
Expand Up @@ -100,6 +100,10 @@

access_ensure_project_level( config_get( 'report_bug_threshold' ) );

if( isset( $_GET['posted'] ) && empty( $_FILE ) && empty( $_POST ) ) {
trigger_error( ERROR_FILE_TOO_BIG, ERROR );
}

$t_bug_data = new BugData;
$t_bug_data->project_id = $t_project_id;
$t_bug_data->reporter_id = auth_get_current_user_id();
Expand Down Expand Up @@ -129,7 +133,7 @@
}

$f_rel_type = gpc_get_int( 'rel_type', BUG_REL_NONE );
$f_files = gpc_get_file( 'ufile', null ); # @todo (thraxisp) Note that this always returns a structure
$f_files = gpc_get_file( 'ufile', null );
$f_report_stay = gpc_get_bool( 'report_stay', false );
$f_copy_notes_from_parent = gpc_get_bool( 'copy_notes_from_parent', false );
$f_copy_attachments_from_parent = gpc_get_bool( 'copy_attachments_from_parent', false );
Expand Down
2 changes: 1 addition & 1 deletion bug_report_page.php
Expand Up @@ -231,7 +231,7 @@
}
?>
<div id="report-bug-div" class="form-container">
<form id="report-bug-form" method="post" <?php echo $t_form_encoding; ?> action="bug_report.php">
<form id="report-bug-form" method="post" <?php echo $t_form_encoding; ?> action="bug_report.php?posted=1">
<fieldset>
<legend><span><?php echo lang_get( 'enter_report_details_title' ) ?></span></legend>
<?php echo form_security_field( 'bug_report' ) ?>
Expand Down

0 comments on commit 7ad9386

Please sign in to comment.