From b1a15ede4bd27e7d375c6ee016146351089e70e3 Mon Sep 17 00:00:00 2001 From: michael-e Date: Mon, 5 Jun 2017 19:34:35 +0200 Subject: [PATCH] Fix validation of IPv6 addresses (#41) Fixes #40 --- lib/class.ABF.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/class.ABF.php b/lib/class.ABF.php index 2cf5470..4018db6 100644 --- a/lib/class.ABF.php +++ b/lib/class.ABF.php @@ -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); } /**