function twitter_probe_detect(App $a, array &$hookData)
{
// Don't overwrite an existing result
- if ($hookData['result']) {
+ if (isset($hookData['result'])) {
return;
}
if (preg_match('=([^@]+)@(?:mobile\.)?twitter\.com$=i', $hookData['uri'], $matches)) {
$nick = $matches[1];
} elseif (preg_match('=^https?://(?:mobile\.)?twitter\.com/(.+)=i', $hookData['uri'], $matches)) {
+ if (strpos($matches[1], '/') !== false) {
+ // Status case: https://twitter.com/<nick>/status/<status id>
+ // Not a contact
+ $hookData['result'] = false;
+ return;
+ }
+
$nick = $matches[1];
} else {
return;