]> git.mxchange.org Git - friendica-addons.git/commitdiff
[twitter] Improve mobile profile URL probe
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 25 Jun 2020 01:29:44 +0000 (21:29 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 25 Jun 2020 01:29:44 +0000 (21:29 -0400)
twitter/twitter.php

index f743d96cedf7a7b7ef52afc2ce88160cceeae4e4..606d9c58dc53ba99f5b01efdc0ddf868d93cd309 100644 (file)
@@ -465,9 +465,9 @@ function twitter_probe_detect(App $a, array &$hookData)
                return;
        }
 
-       if (preg_match('=(.*)@twitter.com=i', $hookData['uri'], $matches)) {
+       if (preg_match('=([^@]+)@(?:mobile\.)?twitter\.com$=i', $hookData['uri'], $matches)) {
                $nick = $matches[1];
-       } elseif (preg_match('=https?://(?:mobile\.)?twitter.com/(.*)=i', $hookData['uri'], $matches)) {
+       } elseif (preg_match('=^https?://(?:mobile\.)?twitter\.com/(.+)=i', $hookData['uri'], $matches)) {
                $nick = $matches[1];
        } else {
                return;