Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
fix IPv6 calculation in format::ip_to_number()
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Feb 15, 2017
1 parent 0695a27 commit d9b6a96
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/wp export-ignore
/release export-ignore
/tests export-ignore
/Gruntfile.js
/package.json
/Gruntfile.js export-ignore
/package.json export-ignore
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"data",
"parsing"
],
"version": "7.0.8",
"version": "7.0.9",
"type": "library",
"homepage": "https://github.com/Blobfolio/blob-common",
"license": "WTFPL",
Expand Down
4 changes: 2 additions & 2 deletions lib/blobfolio/common/ref/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public static function ip_to_number(&$ip) {
try {
$ip_n = inet_pton($ip);
$bin = '';
for ($bit = \blobfolio\common\mb::strlen($ip_n) - 1; $bit >= 0; $bit--) {
for ($bit = strlen($ip_n) - 1; $bit >= 0; $bit--) {
$bin = sprintf('%08b', ord($ip_n[$bit])) . $bin;
}
$dec = '0';
for ($i = 0; $i < \blobfolio\common\mb::strlen($bin); $i++) {
for ($i = 0; $i < strlen($bin); $i++) {
$dec = bcmul($dec, '2', 0);
$dec = bcadd($dec, $bin[$i], 0);
}
Expand Down
Binary file modified release/blob-common.zip
Binary file not shown.
11 changes: 10 additions & 1 deletion release/current.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "Tutan Common",
"Version": "7.0.8",
"Version": "7.0.9",
"DownloadURI": "https:\/\/raw.githubusercontent.com\/Blobfolio\/blob-common\/master\/release\/blob-common.zip",
"Requires": "4.7",
"Tested": "4.7.2",
Expand All @@ -15,6 +15,15 @@
"https:\/\/raw.githubusercontent.com\/Blobfolio\/blob-common\/master\/wp\/img\/assets\/screenshot-1.png": "Full documentation and examples for all functions."
},
"Changelog": [
{
"version": "7.0.9",
"notes": [
{
"type": "fix",
"note": "IPv6 calculations in format::ip_to_number()."
}
]
},
{
"version": "7.0.8",
"notes": [
Expand Down
2 changes: 1 addition & 1 deletion wp/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Tutan Common
Plugin URI: https://github.com/Blobfolio/blob-common
Description: Functions to assist common theme operations.
Version: 7.0.8
Version: 7.0.9
Author: Blobfolio, LLC
Author URI: https://blobfolio.com/
License: WTFPL
Expand Down

0 comments on commit d9b6a96

Please sign in to comment.