Variable ‘post’ was used to hold the current post and the post where the poll appeared, which can be different when polls are quoted.
This pull request has been mentioned on Discourse Meta. There might be relevant details there:
This has bothered me for aaaaages.
Commit has a description and a test!