Skip to content

Commit 751a93a

Browse files
authored
Merge pull request #9082 from MegaBrutal/release-2.1
[2.1] Fix IPv6 reverse hostname display on member profiles
2 parents 375bcd1 + 50edf1d commit 751a93a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Profile-View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function summary($memID)
8686
if (allowedTo('moderate_forum'))
8787
{
8888
// Make sure it's a valid ip address; otherwise, don't bother...
89-
if (preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $memberContext[$memID]['ip']) == 1 && empty($modSettings['disableHostnameLookup']))
89+
if (filter_var($memberContext[$memID]['ip'], FILTER_VALIDATE_IP) && empty($modSettings['disableHostnameLookup']))
9090
$context['member']['hostname'] = host_from_ip($memberContext[$memID]['ip']);
9191
else
9292
$context['member']['hostname'] = '';

0 commit comments

Comments
 (0)