-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
only determine client IP from trusted headers #513
Conversation
By default, we only look for the client's IP address in the REMOTE_ADDR header. This can be extended via hook if there is a need to use headers like X-Forwarded-For ("HTTP_X_FORWARDED_FOR") instead. Headers will be processed in the provided order and return the first valid IP address found.
Maybe this filter is not necessary, as there is one in WP core since 1.5: |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Code change and description by @stklcode
By default, we only look for the client's IP address in the REMOTE_ADDR header. This can be extended via hook if there is a need to use headers like X-Forwarded-For ("HTTP_X_FORWARDED_FOR") instead.
Headers will be processed in the provided order and return the first valid IP address found.