From 7ad938674eb44978991e39a3760c7d49196736e4 Mon Sep 17 00:00:00 2001 From: Paul Richards Date: Sun, 28 Sep 2014 23:31:46 +0100 Subject: [PATCH] Fix #0007118 Attaching an oversized file raises wrong error message --- bug_report.php | 6 +++++- bug_report_page.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bug_report.php b/bug_report.php index 061b98e7cc..73906981eb 100644 --- a/bug_report.php +++ b/bug_report.php @@ -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(); @@ -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 ); diff --git a/bug_report_page.php b/bug_report_page.php index c9f8886ef5..e4d735fa71 100644 --- a/bug_report_page.php +++ b/bug_report_page.php @@ -231,7 +231,7 @@ } ?>
-
action="bug_report.php"> + action="bug_report.php?posted=1">