Plugin Directory

Changeset 1403579


Ignore:
Timestamp:
04/25/2016 07:17:26 AM (10 years ago)
Author:
Tom Braider
Message:

3.5.2

+ Bugfix: undefined function cpd_inet_pton

Location:
count-per-day/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • count-per-day/trunk/counter.php

    r1402072 r1403579  
    44Plugin URI: http://www.tomsdimension.de/wp-plugins/count-per-day
    55Description: Counter, shows reads and visitors per page; today, yesterday, last week, last months ... on dashboard, per shortcode or in widget.
    6 Version: 3.5.1
     6Version: 3.5.2
    77License: Postcardware
    88Author: Tom Braider
     
    1414
    1515$cpd_dir_name = 'count-per-day';
    16 $cpd_version = '3.5.1';
     16$cpd_version = '3.5.2';
    1717
    1818if (strpos($_SERVER['SERVER_NAME'], '.test'))
  • count-per-day/trunk/geoip.php

    r1401848 r1403579  
    141141
    142142}
     143
     144// Windows server < PHP 5.3
     145// PHP without IPv6 support
     146function cpd_inet_pton($ip)
     147{
     148    # ipv4
     149    if (strpos($ip, '.') !== FALSE)
     150    {
     151        if (strpos($ip, ':') === FALSE)
     152            $ip = pack('N',ip2long($ip));
     153            else
     154            {
     155                $ip = explode(':',$ip);
     156                $ip = pack('N',ip2long($ip[count($ip)-1]));
     157            }
     158    }
     159    # ipv6
     160    elseif (strpos($ip, ':') !== FALSE)
     161    {
     162        $ip = explode(':', $ip);
     163        $parts=8-count($ip);
     164        $res='';$replaced=0;
     165        foreach ($ip as $seg)
     166        {
     167            if ($seg!='')
     168                $res .= str_pad($seg, 4, '0', STR_PAD_LEFT);
     169                elseif ($replaced==0)
     170                {
     171                    for ($i=0;$i<=$parts;$i++)
     172                        $res.='0000';
     173                        $replaced=1;
     174                } elseif ($replaced==1)
     175                $res.='0000';
     176        }
     177        $ip = pack('H'.strlen($res), $res);
     178    }
     179    return $ip;
     180}
  • count-per-day/trunk/readme.txt

    r1402072 r1403579  
    44Requires at least: 3.0
    55Tested up to: 4.6
    6 Stable tag: 3.5.1
     6Stable tag: 3.5.2
    77License: Postcardware :)
    88Donate link: http://www.tomsdimension.de/postcards
     
    309309== Changelog ==
    310310
     311= 3.5.2 =
     312+ Bugfix: undefined function cpd_inet_pton
     313
    311314= 3.5.1 =
    312315+ back in WordPress plugin repository
Note: See TracChangeset for help on using the changeset viewer.