]> git.mxchange.org Git - friendica.git/commitdiff
Add Mastodon/Pleroma protocol guessing
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 17 Oct 2018 05:10:07 +0000 (01:10 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 17 Oct 2018 05:10:07 +0000 (01:10 -0400)
src/Core/Protocol.php

index d41250a68643eb2db0ff91cff4bf7f996b9c4d2c..949e2350c3be85ceb72f93d0ad756cb8d2936b84 100644 (file)
@@ -108,6 +108,13 @@ class Protocol
                        }
                }
 
+               // Mastodon, Pleroma
+               if (preg_match('=https?://(.+?)/users/(.+)=ism', $profile_url, $matches)
+                       || preg_match('=https?://(.+?)/@(.+)=ism', $profile_url, $matches)
+               ) {
+                       return self::ACTIVITYPUB;
+               }
+
                // pumpio (http://host.name/user)
                if (preg_match('=https?://([\.\w]+)/([\.\w]+)$=ism', $profile_url, $matches)) {
                        return self::PUMPIO;