twitter-async
twitter-async copied to clipboard
Localhost check doesn't work correctly with IPV6 server name '::1' - results in Uncaught exception 'EpiTwitterException'
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.
Care to submit this as a pull request?
Here you go: https://github.com/jmathai/twitter-async/pull/199
Got the same problem here, localhost with IPv6. I've tried the proposed solution and it works. Please accept the PR.