Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check ip logic is returning false #33

Closed
rajangupta24 opened this issue Jul 15, 2015 · 2 comments
Closed

Check ip logic is returning false #33

rajangupta24 opened this issue Jul 15, 2015 · 2 comments

Comments

@rajangupta24
Copy link

CheckIp function is returning false in case ip = 1.39.45.208

And which shouldn't happen. Tell me how to fix this.

 private function checkIp($ip)
{
    if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
        $longip = ip2long($ip);

        if (! empty($ip)) {
            foreach ($this->reserved_ips as $r) {
                $min = ip2long($r[0]);
                $max = ip2long($r[1]);
                if ($longip >= $min && $longip <= $max) {
                    return false;
                }
            }

            return true;
        }
    } else if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
        return true;
    }
@cringerjs
Copy link

I'm not 100% sure about this methods intention. However, on my development branch on my fork I had modified this function and this IP checks out. I will check to see if I can reproduce on this Torann's current release.

@Torann
Copy link
Owner

Torann commented Oct 1, 2016

The checkIp method has been rewritten in v1.0, see if that fixes it for you. I plan to release v1.0 as soon as my documentation is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants