function linkback_get_target($target) {
// TODO: linkback to a user should work for attention
- // TODO: ignore remote notices and users
// Resolve target (https://github.com/converspace/webmention/issues/43)
$request = HTTPClient::start();
}
try {
- return Notice::fromUri($response->getEffectiveUrl());
+ $notice = Notice::fromUri($response->getEffectiveUrl());
} catch(UnknownUriException $ex) {
preg_match('/\/notice\/(\d+)(?:#.*)?$/', $response->getEffectiveUrl(), $match);
- return Notice::getKV('id', $match[1]);
+ $notice = Notice::getKV('id', $match[1]);
+ }
+
+ if($notice instanceof Notice && $notice->isLocal()) {
+ return $notice;
}
return NULL;