Skip to content

Commit

Permalink
Fix bug with some IPv6 lookups returning the wrong results.
Browse files Browse the repository at this point in the history
  • Loading branch information
IPQualityScore authored Jun 24, 2023
1 parent d00d262 commit 4d7c23a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/IPQualityScore/DB/DBReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down

0 comments on commit 4d7c23a

Please sign in to comment.