diff options
Diffstat (limited to 'includes/pages/user_messages.php')
-rw-r--r-- | includes/pages/user_messages.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php index a811970d..2dea6207 100644 --- a/includes/pages/user_messages.php +++ b/includes/pages/user_messages.php @@ -130,11 +130,11 @@ function user_messages() return error(_('Incomplete call, missing Message ID.'), true); } - $message = DB::select( + $message = DB::selectOne( 'SELECT `RUID` FROM `Messages` WHERE `id`=? LIMIT 1', [$message_id] ); - if (count($message) > 0 && $message[0]['RUID'] == $user['UID']) { + if (!empty($message) && $message['RUID'] == $user['UID']) { DB::update( 'UPDATE `Messages` SET `isRead`=\'Y\' WHERE `id`=? LIMIT 1', [$message_id] @@ -152,11 +152,11 @@ function user_messages() return error(_('Incomplete call, missing Message ID.'), true); } - $message = DB::select( + $message = DB::selectOne( 'SELECT `SUID` FROM `Messages` WHERE `id`=? LIMIT 1', [$message_id] ); - if (count($message) > 0 && $message[0]['SUID'] == $user['UID']) { + if (!empty($message) && $message['SUID'] == $user['UID']) { DB::delete('DELETE FROM `Messages` WHERE `id`=? LIMIT 1', [$message_id]); redirect(page_link_to('user_messages')); } else { |