From 9a0f56dd6ec95626741d2c344ae3bd4579ed7266 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 15 Apr 2011 12:32:58 +0200 Subject: [PATCH] Fixing message when sending a feedback with out content see #2248 --- main/dropbox/dropbox_functions.inc.php | 4 ++-- main/dropbox/index.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main/dropbox/dropbox_functions.inc.php b/main/dropbox/dropbox_functions.inc.php index b13367eef1..795306d981 100755 --- a/main/dropbox/dropbox_functions.inc.php +++ b/main/dropbox/dropbox_functions.inc.php @@ -1005,11 +1005,11 @@ function store_feedback() { return get_lang('FeedbackError'); } - if ($_POST['feedback'] == '') { + if (empty($_POST['feedback'])) { return get_lang('PleaseTypeText'); } else { $sql="INSERT INTO ".$dropbox_cnf['tbl_feedback']." (file_id, author_user_id, feedback, feedback_date) VALUES - ('".Database::escape_string($_GET['id'])."','".api_get_user_id()."','".Database::escape_string($_POST['feedback'])."', '".api_get_utc_datetime()."')"; + ('".intval($_GET['id'])."','".api_get_user_id()."','".Database::escape_string($_POST['feedback'])."', '".api_get_utc_datetime()."')"; Database::query($sql); return get_lang('DropboxFeedbackStored'); } diff --git a/main/dropbox/index.php b/main/dropbox/index.php index dabe03d38f..272076ca5b 100755 --- a/main/dropbox/index.php +++ b/main/dropbox/index.php @@ -220,7 +220,7 @@ if (!isset($_POST['feedback']) && (strstr($_POST['action'], 'move_received') OR // Store Feedback -if ($_POST['feedback']) { +if (isset($_POST['feedback'])) { if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) { api_not_allowed(); }