X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FSearch%2FIndex.php;h=93c1af7aa6d5874afb82f08d744ae4392969c893;hb=69b7923df2beed71419bc38e61ca9755fad24b12;hp=d342892e1a4f8ad76f5644584eedfc80dfac3955;hpb=53e38b03130ea798bba44db44ccb7f331dc4b91d;p=friendica.git diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php index d342892e1a..93c1af7aa6 100644 --- a/src/Module/Search/Index.php +++ b/src/Module/Search/Index.php @@ -1,6 +1,6 @@ get('system', 'block_public') && !Session::isAuthenticated()) { throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.')); } if (DI::config()->get('system', 'local_search') && !Session::isAuthenticated()) { - $e = new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a search.')); - $e->httpdesc = DI::l10n()->t('Public access denied.'); - throw $e; + throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a search.')); } if (DI::config()->get('system', 'permit_crawling') && !Session::isAuthenticated()) { @@ -91,7 +87,7 @@ class Index extends BaseSearch $tag = false; if (!empty($_GET['tag'])) { $tag = true; - $search = '#' . Strings::escapeTags(trim(rawurldecode($_GET['tag']))); + $search = '#' . trim(rawurldecode($_GET['tag'])); } // contruct a wrapper for the search header @@ -171,8 +167,10 @@ class Index extends BaseSearch } if (!empty($uriids)) { - $params = ['order' => ['id' => true], 'group_by' => ['uri-id']]; - $items = Post::toArray(Post::selectForUser(local_user(), Item::DISPLAY_FIELDLIST, ['uri-id' => $uriids], $params)); + $condition = ["(`uid` = ? OR (`uid` = ? AND NOT `global`))", 0, local_user()]; + $condition = DBA::mergeConditions($condition, ['uri-id' => $uriids]); + $params = ['order' => ['id' => true]]; + $items = Post::toArray(Post::selectForUser(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params)); } if (empty($items)) { @@ -199,7 +197,7 @@ class Index extends BaseSearch Logger::info('Start Conversation.', ['q' => $search]); - $o .= conversation(DI::app(), $items, 'search', false, false, 'commented', local_user()); + $o .= DI::conversation()->create($items, 'search', false, false, 'commented', local_user()); if (DI::pConfig()->get(local_user(), 'system', 'infinite_scroll')) { $o .= HTML::scrollLoader();