aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_privmsgs.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r--phpBB/includes/functions_privmsgs.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 862df6e4e1..90ffe4a412 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -864,6 +864,17 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
if ($user->data['user_id'] == $user_id)
{
$user->data['user_unread_privmsg']--;
+
+ // Try to cope with previous wrong conversions...
+ if ($user->data['user_unread_privmsg'] < 0)
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_unread_privmsg = 0
+ WHERE user_id = $user_id";
+ $db->sql_query($sql);
+
+ $user->data['user_unread_privmsg'] = 0;
+ }
}
}