diff options
author | Victor A. Safronov <vitek@vitek.tomsk.ru> | 2016-12-02 16:35:41 +0400 |
---|---|---|
committer | Victor A. Safronov <vitek@vitek.tomsk.ru> | 2016-12-02 16:54:49 +0400 |
commit | 8f841197430c6b8dfdbd43ef255e9986584a07ee (patch) | |
tree | d8f7499fa2151dbc52748cdc65403fccc317b70e /phpBB/includes/functions_privmsgs.php | |
parent | 365489a3171b4d16e645215c4fe4e39ae7c95f4c (diff) | |
download | forums-8f841197430c6b8dfdbd43ef255e9986584a07ee.tar forums-8f841197430c6b8dfdbd43ef255e9986584a07ee.tar.gz forums-8f841197430c6b8dfdbd43ef255e9986584a07ee.tar.bz2 forums-8f841197430c6b8dfdbd43ef255e9986584a07ee.tar.xz forums-8f841197430c6b8dfdbd43ef255e9986584a07ee.zip |
[ticket/13757] Properly fix bug with negative PM count
The fix from PR #4548 doesn't work as expected because
in phpBB the sql_affectedrows() method always returns
a count of matched rows instead of affected rows.
This commit fixes bug properly.
PHPBB3-13757
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r-- | phpBB/includes/functions_privmsgs.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index d7a87ca356..4aad1746d5 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -889,7 +889,8 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id) SET pm_unread = 0 WHERE msg_id = $msg_id AND user_id = $user_id - AND folder_id = $folder_id"; + AND folder_id = $folder_id + AND pm_unread = 1"; $db->sql_query($sql); // If the message is already marked as read, we just skip the rest to avoid negative PM count |