Unverified Commit bd1fa71f by Scott Committed by GitHub

Merge pull request #751 from pupi1985/patch-130

Prevent duplicated vote events
parents 3bed58a6 6e7176d2
......@@ -126,6 +126,10 @@ function qa_vote_set($post, $userid, $handle, $cookieid, $vote)
$vote = (int)min(1, max(-1, $vote));
$oldvote = (int)qa_db_uservote_get($post['postid'], $userid);
if ($oldvote === $vote) {
return;
}
qa_db_uservote_set($post['postid'], $userid, $vote);
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