Code Duplication    Length = 3-3 lines in 2 locations

ratethread.php 2 locations

@@ 70-72 (lines=3) @@
67
    // Check if REG user is trying to vote twice.
68
    $crit_rate = new \CriteriaCompo(new \Criteria('topic_id', $topic_id));
69
    $crit_rate->add(new \Criteria('ratinguser', $ratinguser));
70
    if ($rateHandler->getCount($crit_rate)) {
71
        redirect_header('viewtopic.php?topic_id=' . $topic_id . '&forum=' . $forum . '', 4, _MD_NEWBB_VOTEONCE);
72
    }
73
} else {
74
    // Check if ANONYMOUS user is trying to vote more than once per day.
75
    $crit_rate = new \CriteriaCompo(new \Criteria('topic_id', $topic_id));
@@ 79-81 (lines=3) @@
76
    $crit_rate->add(new \Criteria('ratinguser', $ratinguser));
77
    $crit_rate->add(new \Criteria('ratinghostname', $ip));
78
    $crit_rate->add(new \Criteria('ratingtimestamp', time() - (86400 * $anonwaitdays), '>'));
79
    if ($rateHandler->getCount($crit_rate)) {
80
        redirect_header('viewtopic.php?topic_id=' . $topic_id . '&forum=' . $forum . '', 4, _MD_NEWBB_VOTEONCE);
81
    }
82
}
83
$rateObject = $rateHandler->create();
84
$rateObject->setVar('rating', $rate * 2);