]> git.mxchange.org Git - friendica.git/commitdiff
Simplifiy the split
authorMichael <heluecht@pirati.ca>
Wed, 11 May 2022 06:55:02 +0000 (06:55 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 11 May 2022 06:55:02 +0000 (06:55 +0000)
src/Util/Network.php

index bc374c2bcc348a43834017046d5583be978dd814..cdcb39a49605c2529e3de2f0d20b449deb9de44e 100644 (file)
@@ -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;