From 8a14e4261d3247dc02254cb91fdb9b82e051f324 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 23 Apr 2023 18:44:39 +0000 Subject: check for uuid so that will be also catch items that were posted from alternate locations --- Zotlabs/Module/Item.php | 7 +++---- Zotlabs/Module/Search.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index a61785a8b..a5f66d72e 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -63,8 +63,8 @@ class Item extends Controller { // do we have the item (at all)? - $r = q("select parent_mid from item where mid = '%s' $item_normal limit 1", - dbesc(z_root() . '/item/' . $item_id) + $r = q("select parent_mid from item where uuid = '%s' $item_normal limit 1", + dbesc($item_id) ); if (!$r) { @@ -177,8 +177,7 @@ class Item extends Controller { // do we have the item (at all)? // add preferential bias to item owners (item_wall = 1) - $r = q("select * from item where mid = '%s' or uuid = '%s' $item_normal order by item_wall desc limit 1", - dbesc(z_root() . '/item/' . $item_id), + $r = q("select * from item where uuid = '%s' $item_normal order by item_wall desc limit 1", dbesc($item_id) ); diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php index eb8f238e9..6b1060570 100644 --- a/Zotlabs/Module/Search.php +++ b/Zotlabs/Module/Search.php @@ -58,7 +58,7 @@ class Search extends Controller { $o .= search($search, 'search-box', '/search', ((local_channel()) ? true : false)); - if (local_channel() && strpos($search, 'https://') === 0 && !$update && !$load) { + if (local_channel() && str_starts_with($search, 'https://') && !$update && !$load) { $url = htmlspecialchars_decode($search); -- cgit v1.2.3