From a8752844eff70e714fc8c5faaa3fdc62c95b7e04 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 21 Aug 2022 16:02:51 +0000 Subject: Activity: check for other forms of as:Public, Search: make sure to run htmlspecialchars_decode on the AP url so that previously encoded chars will be decoded again --- Zotlabs/Module/Search.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Zotlabs/Module/Search.php') diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php index efea7bbdd..da4752186 100644 --- a/Zotlabs/Module/Search.php +++ b/Zotlabs/Module/Search.php @@ -59,15 +59,18 @@ class Search extends Controller { $o .= search($search, 'search-box', '/search', ((local_channel()) ? true : false)); if (local_channel() && strpos($search, 'https://') === 0 && !$update && !$load) { - if (strpos($search, 'b64.') !== false) { - if (strpos($search, '?') !== false) { - $search = strtok($search, '?'); + + $url = htmlspecialchars_decode($search); + + if (strpos($url, 'b64.') !== false) { + if (strpos($url, '?') !== false) { + $url = strtok($url, '?'); } - $search = unpack_link_id(basename($search)); + $url = unpack_link_id(basename($url)); } - $f = Libzot::fetch_conversation(App::get_channel(), punify($search), true); + $f = Libzot::fetch_conversation(App::get_channel(), punify($url), true); if ($f) { $mid = $f[0]['message_id']; @@ -83,7 +86,7 @@ class Search extends Controller { else { // try other fetch providers (e.g. diaspora, pubcrawl) $hookdata = [ - 'url' => punify($search) + 'url' => punify($url) ]; call_hooks('fetch_provider', $hookdata); } -- cgit v1.2.3