• Resolved rjhardaway

    (@rjhardaway)


    IP Geo Block got corrupted this morning and I received the following error:

    Fatal error: Uncaught ArithmeticError: Bit shift by negative number in /home/cayuga7/yourny23.org/wp-content/plugins/ip-geo-block/includes/Net/IPv4.php:14 Stack trace: #0 /home/cayuga7/yourny23.org/wp-content/plugins/ip-geo-block/classes/class-ip-geo-block.php(806): Net_IPv4::ipInNetwork(‘67.249.139.82’, ‘120.24.60.0/255’) #1 /home/cayuga7/yourny23.org/wp-content/plugins/ip-geo-block/classes/class-ip-geo-block.php(831): IP_Geo_Block::check_ips(Array, ‘120.24.60.0/255…’) #2 /home/cayuga7/yourny23.org/wp-includes/class-wp-hook.php(286): IP_Geo_Block->check_ips_black(Array, Array) #3 /home/cayuga7/yourny23.org/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Array) #4 /home/cayuga7/yourny23.org/wp-content/plugins/ip-geo-block/classes/class-ip-geo-block.php(466): apply_filters(‘ip-geo-block-ad…’, Array, Array) #5 /home/cayuga7/yourny23.org/wp-content/plugins/ip-geo-block/classes/class-ip-geo-block.php(630): IP_Geo_Block->validate_ip(‘admin’, Array, 1) #6 /home/cayuga7/yourny23.org/wp-includes/class-wp-hook.php(2 in /home/cayuga7/yourny23.org/wp-content/plugins/ip-geo-block/includes/Net/IPv4.php on line 14

    This error blocks me from logging in as admin. I tried disabling/deleting IP Geo Block, but when I reinstall and activate it, I get the same error.

    Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi @rjhardaway,

    It might be happened in Net DNS2 library.

    You seem to put ‘120.24.60.0/255’ into Whitelist or Blacklist of extra IP addresses prior to country code.

    Regarding to CIDR of IPv4, the notation is like ‘a.b.c.d/n’ where n = 0 〜 32. But you specified n = 255.

    Check out IPv4 CIDR blocks.

    when I reinstall and activate it, I get the same error.

    Yes, it might happen until you remove ‘120.24.60.0/255’ from database.

    Well…, I made a special version which limit the number ‘n’.

    Please download “class-ip-geo-block.php” from here and upload it into your /wp-content/plugins/ip-geo-block/classes/.

    Good luck!

    Plugin Author tokkonopapa

    (@tokkonopapa)

    By the way, you probably tend to set 120.24.60.0 to 120.24.60.255. In that case, the right value should be ‘120.24.60.0/24′.

    The ‘n’ means the number of bits to mask the whole IP address. And the maximum number of bits is 32 bits for IPv4 and 128 bits for IPv6.

    So ‘a.b.c.d/32′ is equivalent to ‘a.b.c.d’, that’s to say, just one IP address.

    Please use “CIDR calculator for IPv4/IPv6” (click the “life buoy” button) built in this plugin!

    • This reply was modified 7 years, 10 months ago by tokkonopapa.
    Plugin Author tokkonopapa

    (@tokkonopapa)

    Hi @rjhardaway,

    In version 3.0.10.1, your issue should be fixed as the prefix of CIDR will be limited to the proper value.

    I hope you to update the new version.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Fatal error: Uncaught ArithmeticError’ is closed to new replies.