]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Somewhat simpler regex. Thanks acct:takeshitakenji@gs.kawa-kun.com
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 22 Apr 2017 10:12:27 +0000 (12:12 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 22 Apr 2017 10:12:27 +0000 (12:12 +0200)
plugins/OStatus/OStatusPlugin.php

index 4a1d7683ccca8324898ffd1162eecca4ebc15d71..1750016ace15cb0e71018e2c4e3743c471101c58 100644 (file)
@@ -264,7 +264,8 @@ class OStatusPlugin extends Plugin
     static function extractWebfingerIds($text)
     {
         $wmatches = array();
-        $result = preg_match_all('/(?:^|\s+)@((?:\w+[\w\-\_\.]?)*(?:[\w\-\_\.]*\w+)@'.URL_REGEX_DOMAIN_NAME.')/',
+        // Maybe this should harmonize with lib/nickname.php and Nickname::WEBFINGER_FMT
+        $result = preg_match_all('/(?<!\S)@((?:\w+[\w\-\_\.]*)?\w+@'.URL_REGEX_DOMAIN_NAME.')/',
                        $text,
                        $wmatches,
                        PREG_OFFSET_CAPTURE);