Added IPAddr verification of IP Addresses
if election
voter = QuickVoter.new
voter.election = election
if election
voter = QuickVoter.new
voter.election = election
- voter.ipaddress = "0.0.0.0"
+ voter.ipaddress = "XMLRPC Request"
voter.session_id = "XMLRPC:#{voter_id}"
voter.vote=Vote.new
voter.vote.votes=vote_list[0]
voter.session_id = "XMLRPC:#{voter_id}"
voter.vote=Vote.new
voter.vote.votes=vote_list[0]
<h1>Results</h1>
<% if @election.shortdesc %>
<h1>Results</h1>
<% if @election.shortdesc %>
<% next unless voter.voted? %>
<tr>
<td><%= voter.ipaddress %></td>
<% next unless voter.voted? %>
<tr>
<td><%= voter.ipaddress %></td>
- <td><%= `host #{voter.ipaddress}`.sub(/^.*pointer (.*)\.$/, '\1') %></td>
+ <td><% begin %>
+ <%= `host #{IPAddr.new(voter.ipaddress).to_s}`.sub(/^.*pointer (.*)\.$/, '\1') %>
+
+ <% rescue ArgumentError => err %>
+ <%= " - " %>
+ <% end %>
+ </td>
<td><%= voter.vote.votestring %></td>
</tr>
<% end %>
<td><%= voter.vote.votestring %></td>
</tr>
<% end %>