+
+function follow_remote_item($url)
+{
+ $item_id = Item::fetchByLink($url, local_user());
+ if (!$item_id) {
+ // If the user-specific search failed, we search and probe a public post
+ $item_id = Item::fetchByLink($url);
+ }
+
+ if (!empty($item_id)) {
+ $item = Item::selectFirst(['guid'], ['id' => $item_id]);
+ if (DBA::isResult($item)) {
+ DI::baseUrl()->redirect('display/' . $item['guid']);
+ }
+ }
+}