Index: branches/5.3.x/units/polls/poll_tp.php =================================================================== diff -u -N -r15490 -r15670 --- branches/5.3.x/units/polls/poll_tp.php (.../poll_tp.php) (revision 15490) +++ branches/5.3.x/units/polls/poll_tp.php (.../poll_tp.php) (revision 15670) @@ -1,6 +1,6 @@ getObject($params); /* @var $object kDBItem */ - if (!$object->GetDBField('AllowMultipleVotings')) { + if ( !$object->GetDBField('AllowMultipleVotings') ) { + $where_clause = Array ( + 'PollId = ' . $object->GetID(), + 'CreatedById = ' . $this->Application->RecallVar('user_id'), + 'UserIP = ' . $this->Conn->qstr($this->Application->getClientIp()), + ); + $sql = 'SELECT StatisticsId - FROM '.TABLE_PREFIX.'PollsStatistics - WHERE PollId = '.$object->GetID().' AND CreatedById = '.$this->Application->RecallVar('user_id').' AND UserIP = '.$this->Conn->qstr(getenv('REMOTE_ADDR')); + FROM ' . TABLE_PREFIX . 'PollsStatistics + WHERE (' . implode(') AND (', $where_clause) . ')'; + return $this->Conn->GetOne($sql) > 0; }