Commit 6e7176d2 by pupi1985

Prevent duplicated vote events

parent 7ed3f6a0
...@@ -126,6 +126,10 @@ function qa_vote_set($post, $userid, $handle, $cookieid, $vote) ...@@ -126,6 +126,10 @@ function qa_vote_set($post, $userid, $handle, $cookieid, $vote)
$vote = (int)min(1, max(-1, $vote)); $vote = (int)min(1, max(-1, $vote));
$oldvote = (int)qa_db_uservote_get($post['postid'], $userid); $oldvote = (int)qa_db_uservote_get($post['postid'], $userid);
if ($oldvote === $vote) {
return;
}
qa_db_uservote_set($post['postid'], $userid, $vote); qa_db_uservote_set($post['postid'], $userid, $vote);
qa_db_post_recount_votes($post['postid']); qa_db_post_recount_votes($post['postid']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment