From 44bf674727db0d881931a8395eeec838259b23d3 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 24 Jun 2020 21:29:44 -0400 Subject: [PATCH] [twitter] Improve mobile profile URL probe --- twitter/twitter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twitter/twitter.php b/twitter/twitter.php index f743d96c..606d9c58 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -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;