From 50edf1ddbb14cc24d1e089cc6bc1d0aa17b42ef8 Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Sun, 18 Jan 2026 00:30:00 +0100 Subject: [PATCH] Fix IPv6 reverse hostname display on member profiles --- Sources/Profile-View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Profile-View.php b/Sources/Profile-View.php index f06637cbf03..d0a169e2988 100644 --- a/Sources/Profile-View.php +++ b/Sources/Profile-View.php @@ -86,7 +86,7 @@ function summary($memID) if (allowedTo('moderate_forum')) { // Make sure it's a valid ip address; otherwise, don't bother... - if (preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $memberContext[$memID]['ip']) == 1 && empty($modSettings['disableHostnameLookup'])) + if (filter_var($memberContext[$memID]['ip'], FILTER_VALIDATE_IP) && empty($modSettings['disableHostnameLookup'])) $context['member']['hostname'] = host_from_ip($memberContext[$memID]['ip']); else $context['member']['hostname'] = '';