From 8df5069f702de03b856e5394bcd3864f89170f76 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 23 Jul 2012 16:38:34 -0500 Subject: [PATCH] Fixed query for dropbox files - refs #5057 --- main/dropbox/dropbox_class.inc.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/main/dropbox/dropbox_class.inc.php b/main/dropbox/dropbox_class.inc.php index 81c65f6166..b02f7095f9 100644 --- a/main/dropbox/dropbox_class.inc.php +++ b/main/dropbox/dropbox_class.inc.php @@ -398,16 +398,14 @@ class Dropbox_Person $person_tbl = Database::get_course_table(TABLE_DROPBOX_PERSON); $file_tbl = Database::get_course_table(TABLE_DROPBOX_FILE); // Find all entries where this person is the recipient - $sql = "SELECT r.file_id, r.cat_id FROM $post_tbl r, $person_tbl p - WHERE - r.c_id = $course_id AND - p.c_id = $course_id AND - r.dest_user_id = '".Database::escape_string($this->userId)."' AND - r.dest_user_id = p.user_id AND - r.file_id = p.file_id $condition_session AND - r.c_id = $course_id AND - p.c_id = $course_id - "; + $sql = "SELECT r.file_id, r.cat_id FROM $post_tbl r, $person_tbl p ". + " WHERE ". + " r.c_id = $course_id AND ". + " p.c_id = $course_id AND ". + " r.dest_user_id = ".intval($this->userId)." AND ". + " r.file_id = p.file_id $condition_session AND ". + " r.c_id = $course_id AND ". + " p.c_id = $course_id "; //if (intval($_SESSION['id_session']>0)) { $sql .= " AND r.session_id = ".intval($_SESSION['id_session']); }