Skip to content

Commit

Permalink
Solve database issue in social wall - refs #4507
Browse files Browse the repository at this point in the history
  • Loading branch information
ilosada committed Mar 27, 2015
1 parent e03283e commit 0175956
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main/inc/lib/social.lib.php
Expand Up @@ -1229,6 +1229,7 @@ public static function getWallMessages($userId, $messageStatus, $parentId = '',
$start = '0000-00-00';
}
$tblMessage = Database::get_main_table(TABLE_MAIN_MESSAGE);
$tblMessageAttachment = Database::get_main_table(TABLE_MESSAGE_ATTACHMENT);
$userId = intval($userId);
$start = Database::escape_string($start);
// TODO: set a maximum of 3 months for messages
Expand All @@ -1238,8 +1239,8 @@ public static function getWallMessages($userId, $messageStatus, $parentId = '',
$limit = intval($limit);
$messages = array();
$sql = "SELECT id, user_sender_id,user_receiver_id, send_date, content, parent_id,
(SELECT ma.path from message_attachment ma WHERE ma.message_id = tm.id ) as path,
(SELECT ma.filename from message_attachment ma WHERE ma.message_id = tm.id ) as filename
(SELECT ma.path from $tblMessageAttachment ma WHERE ma.message_id = tm.id ) as path,
(SELECT ma.filename from $tblMessageAttachment ma WHERE ma.message_id = tm.id ) as filename
FROM $tblMessage tm
WHERE user_receiver_id = $userId
AND send_date > '$start' ";
Expand Down

0 comments on commit 0175956

Please sign in to comment.