diff --git a/Sources/Profile-View.php b/Sources/Profile-View.php index f06637cbf0..d0a169e298 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'] = '';