Browse Source

Merge pull request #992 from MrPetovan/task/8517-probe-mobile-twitter

[twitter] Improve mobile profile URL probe
pull/993/head
Michael Vogel 1 year ago
committed by GitHub
parent
commit
a078b08797
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      twitter/twitter.php

4
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;

Loading…
Cancel
Save