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

Use right IP when IP string contain more than one IP adress #2

Closed
everyx opened this issue Mar 4, 2017 · 0 comments
Closed

Use right IP when IP string contain more than one IP adress #2

everyx opened this issue Mar 4, 2017 · 0 comments
Labels

Comments

@everyx
Copy link
Member

everyx commented Mar 4, 2017

Hi, my site is use free cloudflare CDN, and all users IP address in Mibew backend is x.x.x.x (x.x.x.x), we should use the IP in the parentheses.

I just review the code, and I think the problem is in this code:

            $count = preg_match_all(
                "/(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3})/",
                $function['arguments']['ip'],
                $matches
            );

the $function['arguments']['ip'], can not return a IP string as x.x.x.x (x.x.x.x) format but just return the first IP (not the IP in the parentheses), but I'm not sure how to get complete IP string contain two IP address.

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

Successfully merging a pull request may close this issue.

2 participants