From 4d7c23a2f1f7d2cc39d5ae7b0834b5fb92668088 Mon Sep 17 00:00:00 2001 From: IPQualityScore <50187766+IPQualityScore@users.noreply.github.com> Date: Sat, 24 Jun 2023 11:39:37 -0400 Subject: [PATCH] Fix bug with some IPv6 lookups returning the wrong results. --- src/IPQualityScore/DB/DBReader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IPQualityScore/DB/DBReader.php b/src/IPQualityScore/DB/DBReader.php index 44e1d07..39dd72f 100644 --- a/src/IPQualityScore/DB/DBReader.php +++ b/src/IPQualityScore/DB/DBReader.php @@ -229,7 +229,7 @@ protected function IP2Literal($ip){ $result = ""; if($this->ipv6){ foreach(explode(':', static::expand($ip)) as $block){ - $result .= base_convert($block, 16, 2); + $result .= str_pad(base_convert($block, 16, 2), 16, "0", STR_PAD_LEFT); } } else { foreach(explode('.', $ip) as $block){