Ahh so you will need to find each vote which is corrupt and clear it. I know id80 need clearing cuz thats mine i tested it on. To fix the flaw is easy though simple if statement...
code:
if ($_POST['vote'] < 0 || $_POST['vote'] > 5) {
echo "Error with voting";
die();
}