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

Ip without dots #92

Open
Phobos94 opened this issue Jul 10, 2024 · 1 comment
Open

Ip without dots #92

Phobos94 opened this issue Jul 10, 2024 · 1 comment

Comments

@Phobos94
Copy link

Phobos94 commented Jul 10, 2024

Hello everyone.

Following the installation of the "um-browser-detect" plugin, the IP address is recorded during registration but there is no dots between the numbers. Do you have a solution to resolve this problem?

Thanking you

ip ultimate member

@sao321
Copy link

sao321 commented Aug 9, 2024

This is caused by a improper sanitization in Core.php line 98

$field_value = isset( $_SERVER['REMOTE_ADDR'] ) ? wp_unslash( sanitize_key( $_SERVER['REMOTE_ADDR'] ) ) : '';

sanitize_key() is intended for sanitizing keys and slugs, not IP addresses. If we chagne it to sanitize_text_field then it would work without any problem. This is what I did:

$field_value = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( $_SERVER['REMOTE_ADDR'] ) : '';

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

No branches or pull requests

2 participants