Skip to content

Update GeoIP2.php to not crash on multiple addresses #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevepowell2000
Copy link

Better error message to share what was in $address, instead of just assuming it was a street address.

if using a proxy like CloudFlare, which may return multiple IP addresses like X-forwarded-for and X-real-ip and the IP address of the Cloudflare proxy... then the $address may be a comma delimited list of addresses and both executeQuery AND geocodeQuery will fail. Suggest just grabbing the first address and moving on .... something like $address = explode(',', $address)[0];

Better error message to share what was in $address, instead of just assuming it was a street address.

if using a proxy like CloudFlare, the $address may be a comma delimited list of addresses and both executeQuery AND geocodeQuery will fail. 
Suggest just grabbing the first address and moving on ....something like  $address = explode(',', $address)[0];
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

Successfully merging this pull request may close these issues.

1 participant