Jump to content

depreciated in system error log


keat

Recommended Posts

I found this in my error logs today. Looks like it's been ongoing for a while, and I guess it's related to the security suite.

[Deprecated] /home/xxxxxxxxx/public_html/v6cart/modules/plugins/ccss/ccss.class.php:239 - Function split() is deprecated

 

CubeCart Version 6.0.10
PHP Version 5.3.29
MySQL Version 5.5.47
Link to comment
Share on other sites

ccss.class.php

I found the version number and it is 1.06

 

Right at the end of the file.

 

private function _ipCIDRCheck ($IP, $CIDR) {
    list ($net, $mask) = split ("/", $CIDR); // $mask is empty if not in CIDR notation

    $ip_net = ip2long ($net);

    $mask = (!empty($mask)) ? $mask : 32; // force CIDR /32 if empty $mask

    $ip_mask = ~((1 << (32 - $mask)) - 1);

    $ip_ip = ip2long ($IP);

    $ip_ip_net = $ip_ip & $ip_mask;

    return ($ip_ip_net == $ip_net);
  }
}
?>
 

Link to comment
Share on other sites

Oh! That's the hack to allow for CIDR notation. explode() should work.

On the other hand, I now read that list() will error if the resulting array from explode() (or split) is less than the two elements list() is expecting. So:

  private function _ipCIDRCheck($IP, $CIDR) {
    list($net, $mask) = array_pad(explode("/", $CIDR),2,''); // $mask will be empty if not in CIDR notation
    $ip_net = ip2long($net);
    $mask = (!empty($mask)) ? $mask : 32; // force CIDR /32 if empty $mask
    $ip_mask = ~((1 << (32 - $mask)) - 1);
    $ip_ip = ip2long($IP);
    $ip_ip_net = $ip_ip & $ip_mask;
    return ($ip_ip_net == $ip_net);
  }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...