[twitter] Improve mobile profile URL probe

This commit is contained in:
Hypolite Petovan 2020-06-24 21:29:44 -04:00
parent 94c658b105
commit 44bf674727

View File

@ -465,9 +465,9 @@ function twitter_probe_detect(App $a, array &$hookData)
return; return;
} }
if (preg_match('=(.*)@twitter.com=i', $hookData['uri'], $matches)) { if (preg_match('=([^@]+)@(?:mobile\.)?twitter\.com$=i', $hookData['uri'], $matches)) {
$nick = $matches[1]; $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]; $nick = $matches[1];
} else { } else {
return; return;