]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
New domain regexp for WebFinger matching.
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 22 Apr 2017 08:51:03 +0000 (10:51 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 22 Apr 2017 09:23:41 +0000 (11:23 +0200)
plugins/OStatus/OStatusPlugin.php

index eaf09bf6fd0fb6852c6c36d4bbe2b67a24b5b7b9..09a25495dff7db432f2de945d421c3bfb922ce1b 100644 (file)
@@ -287,7 +287,7 @@ class OStatusPlugin extends Plugin
 
         $wmatches = array();
         // Webfinger matches: @user@example.com or even @user--one.george_orwell@1984.biz
-        if (preg_match_all('!(?:^|\s+)@((?:\w+[\w\-\_\.]?)*(?:[\w\-\_\.]*\w+)@(?:\w+\-?\w+\.)*\w+(?:\w+\-\w+)*\.\w+)!',
+        if (preg_match_all('/(?:^|\s+)@((?:\w+[\w\-\_\.]?)*(?:[\w\-\_\.]*\w+)@(?:(?!-)[A-Za-z0-9\-]{1,63}(?<!-)\.)+[A-Za-z]{2,10})/',
                        $text,
                        $wmatches,
                        PREG_OFFSET_CAPTURE)) {