From 695e3d8b611364ce864a71467eebd666de2d9c19 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 11 May 2022 06:55:02 +0000 Subject: [PATCH] Simplifiy the split --- src/Util/Network.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Util/Network.php b/src/Util/Network.php index bc374c2bcc..cdcb39a496 100644 --- a/src/Util/Network.php +++ b/src/Util/Network.php @@ -475,10 +475,10 @@ class Network $parts['host'] = idn_to_ascii($parts['host']); $uri = self::unparseURL($parts); } elseif (strstr($uri, '@')) { - $host = idn_to_ascii(substr($uri, strpos($uri, '@') + 1)); - $nick = substr($uri, 0, strpos($uri, '@')); - - $uri = $nick . '@' . $host; + $parts = explode('@', $uri); + if (count($parts) == 2) { + $uri = $parts[0] . '@' . idn_to_ascii($parts[1]); + } } return $uri;