Add checks for numeric column data

[Fixes #6303]
unstable
James Lee 2012-02-02 12:00:08 -07:00
parent eb795514b3
commit b347418f90
1 changed files with 2 additions and 0 deletions

View File

@ -191,6 +191,8 @@ class Table
1
elsif Rex::Socket.dotted_ip?(a[index]) and Rex::Socket.dotted_ip?(b[index])
Rex::Socket::addr_atoi(a[index]) <=> Rex::Socket::addr_atoi(b[index])
elsif a[index] =~ /^[0-9]+$/ and b[index] =~ /^[0-9]+$/
a[index].to_i <=> b[index].to_i
else
a[index] <=> b[index] # assumes otherwise comparable.
end