]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/OStatusPlugin.php
Test URLs against blacklist also on PuSH subscriptions.
[quix0rs-gnu-social.git] / plugins / OStatus / OStatusPlugin.php
index 4a1d7683ccca8324898ffd1162eecca4ebc15d71..1f76b56a20bd08ed62314692f151d09508c6329f 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);
@@ -348,7 +349,7 @@ class OStatusPlugin extends Plugin
 
         foreach (self::extractUrlMentions($text) as $wmatch) {
             list($target, $pos) = $wmatch;
-            $schemes = array('http', 'https');
+            $schemes = array('https', 'http');
             foreach ($schemes as $scheme) {
                 $url = "$scheme://$target";
                 $this->log(LOG_INFO, "Checking profile address '$url'");