Skip to content

Commit

Permalink
Fix validation of IPv6 addresses (#41)
Browse files Browse the repository at this point in the history
Fixes #40
  • Loading branch information
michael-e authored and nitriques committed Jun 5, 2017
1 parent 62a7443 commit b1a15ed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/class.ABF.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,13 +620,11 @@ private function __getListEntries($tbl, $where='', $order='IP ASC')
*/

/**
* @return boolean - Really simple validation for IP Addresses
* @return boolean - validation for IP addresses
*/
public function isIPValid($ip)
{
// ip v4 is at least 7 char max 15
// hash is 36 char
return strlen($ip) > 6 && strlen($ip) < 16;
return filter_var($ip, FILTER_VALIDATE_IP);
}

/**
Expand Down

0 comments on commit b1a15ed

Please sign in to comment.