[twitter] Improve mobile profile URL probe #992

Merged
MrPetovan merged 1 commit from task/8517-probe-mobile-twitter into 2020.06-rc 2020-06-25 08:41:11 +02:00
Showing only changes of commit 44bf674727 - Show all commits

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;