diff --git a/main/dropbox/dropbox_class.inc.php b/main/dropbox/dropbox_class.inc.php index 79529dce5f..c524fbd3fb 100755 --- a/main/dropbox/dropbox_class.inc.php +++ b/main/dropbox/dropbox_class.inc.php @@ -199,16 +199,16 @@ class Dropbox_Work { $this->last_upload_date = stripslashes($res["last_upload_date"]); $this->category = $res['cat_id']; - // Getting the feedback on the work. if ($_GET['action']=='viewfeedback' AND $this->id==$_GET['id']) { $feedback2=array(); $sql_feedback = "SELECT * FROM ".dropbox_cnf("tbl_feedback")." WHERE file_id='".$id."' ORDER BY feedback_id ASC"; $result = Database::query($sql_feedback, __FILE__, __LINE__); - while ($row_feedback=Database::fetch_array($result)) { + while ($row_feedback=Database::fetch_array($result)) { + $row_feedback['feedback'] = Security::remove_XSS($row_feedback['feedback']); $feedback2[]=$row_feedback; } - $this->feedback2=$feedback2; + $this->feedback2= $feedback2; } /* // RH: Feedback diff --git a/main/dropbox/dropbox_functions.inc.php b/main/dropbox/dropbox_functions.inc.php index 2b6334fbe6..6d38c677ef 100755 --- a/main/dropbox/dropbox_functions.inc.php +++ b/main/dropbox/dropbox_functions.inc.php @@ -1152,8 +1152,11 @@ function feedback_form() $number_users_who_see_file=Database::num_rows($result); if ($number_users_who_see_file>1) { - $return .= '
'; + $token = Security::get_token(); + $return .= ''; + $return .= ''; + $return .= '
'; } else { diff --git a/main/dropbox/index.php b/main/dropbox/index.php index dd3f1b551c..ee1fb247b1 100755 --- a/main/dropbox/index.php +++ b/main/dropbox/index.php @@ -235,15 +235,19 @@ if (!isset($_POST['feedback']) && (strstr($_POST['action'],'move_received') OR } // *** Store Feedback *** -if ($_POST['feedback']) { + +if ($_POST['feedback']) { if (api_get_session_id()!=0 && api_is_allowed_to_session_edit(false,true)==false) { api_not_allowed(); - } - $display_message = store_feedback(); - Display :: display_normal_message($display_message); + } + $check = Security::check_token(); + if ($check) { + $display_message = store_feedback(); + Display :: display_normal_message($display_message); + Security::check_token(); + } } - // *** Error Message *** if (isset($_GET['error']) AND !empty($_GET['error'])) { Display :: display_normal_message(get_lang($_GET['error']));