From 2c240f8a7b36feab129336b7e36273cdb9798364 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Tue, 11 Jun 2013 00:09:14 +0530 Subject: [PATCH] [ticket/11566] display error instead of trigger_error When the error report is empty display error in the template instead of trigger_error PHPBB3-11566 --- phpBB/report.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/phpBB/report.php b/phpBB/report.php index 7f6cd4a792..1ae0abcdc2 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -151,20 +151,20 @@ if ($submit && $reason_id) $error[] = $vc_response; } + $sql = 'SELECT * + FROM ' . REPORTS_REASONS_TABLE . " + WHERE reason_id = $reason_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row || (!$report_text && strtolower($row['reason_title']) == 'other')) + { + $error[] = $user->lang('EMPTY_REPORT'); + } + if (!sizeof($error)) { - $sql = 'SELECT * - FROM ' . REPORTS_REASONS_TABLE . " - WHERE reason_id = $reason_id"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (!$row || (!$report_text && strtolower($row['reason_title']) == 'other')) - { - trigger_error('EMPTY_REPORT'); - } - $sql_ary = array( 'reason_id' => (int) $reason_id, 'post_id' => $post_id,