Skip to content

[2.1] Fix IPv6 reverse hostname display on member profiles#9082

Open
MegaBrutal wants to merge 1 commit intoSimpleMachines:release-2.1from
MegaBrutal:release-2.1
Open

[2.1] Fix IPv6 reverse hostname display on member profiles#9082
MegaBrutal wants to merge 1 commit intoSimpleMachines:release-2.1from
MegaBrutal:release-2.1

Conversation

@MegaBrutal
Copy link

Hostnames for IPv6 addresses didn't appear on member profiles because the regex to filter invalid IP values only matched for IPv4 addresses. I changed the test to the PHP filter_var() function which should be more robust.

@jdarwood007 jdarwood007 added this to the 2.1.8 milestone Mar 8, 2026
@jdarwood007
Copy link
Member

@MegaBrutal
Thank you for your contribution.

Do you have the related PR for SMF 3.0?

We can look at including this in a future 2.1 update, but we also need to patch it in 3.0.

@MegaBrutal
Copy link
Author

@jdarwood007 SMF 3.0 already uses filter_var, no fix is needed there.

if (Utils::$context['can_see_ip'] && empty(Config::$modSettings['disableHostnameLookup']) && filter_var(Profile::$member->formatted['ip'], FILTER_VALIDATE_IP) !== false) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants