Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Localhost check doesn't work correctly with IPV6 server name '::1' - results in Uncaught exception 'EpiTwitterException' #198

Open
alex-gonzalez opened this issue Feb 24, 2014 · 3 comments

Comments

@alex-gonzalez
Copy link

When using the library on my local machine with IPV6 the check for localhost in EpiOAuth isn't triggered because $_SERVER['SERVER_ADDR'] is '::1'

I changed line 171 in EpiOAuth from:
if(isset($_SERVER ['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] != '127.0.0.1')

to:
if(isset($_SERVER ['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] != '127.0.0.1' && $_SERVER['SERVER_ADDR'] != '::1')

This may be useful to other developers working on their local machine and getting this exception.

@jmathai
Copy link
Owner

jmathai commented Feb 27, 2014

Care to submit this as a pull request?

@alex-gonzalez
Copy link
Author

Here you go: #199

@cmoralesweb
Copy link

Got the same problem here, localhost with IPv6. I've tried the proposed solution and it works. Please accept the PR.

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

No branches or pull requests

3 participants