summaryrefslogtreecommitdiff
path: root/includes/pages/user_messages.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/pages/user_messages.php')
-rw-r--r--includes/pages/user_messages.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php
index 320af9df..06ae7e75 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 {