From 016507f346e604617ffe1938ef8133bb91b03928 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 24 Dec 2019 17:34:57 -0500 Subject: [PATCH] Use BaseURL::redirect instead of deprecated App->internalRedirect in Search\Index --- src/Module/Search/Index.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php index 691fc3ec8..29ebeffd0 100644 --- a/src/Module/Search/Index.php +++ b/src/Module/Search/Index.php @@ -3,6 +3,7 @@ namespace Friendica\Module\Search; use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\Content\Nav; use Friendica\Content\Pager; use Friendica\Content\Text\HTML; @@ -96,11 +97,15 @@ class Index extends BaseSearchModule } if (parse_url($search, PHP_URL_SCHEME) != '') { - $id = Item::fetchByLink($search); - if (!empty($id)) { - $item = Item::selectFirst(['guid'], ['id' => $id]); + /** @var BaseURL $baseURL */ + $baseURL = self::getClass(BaseURL::class); + + // Post URL search + $item_id = Item::fetchByLink($search); + if (!empty($item_id)) { + $item = Item::selectFirst(['guid'], ['id' => $item_id]); if (DBA::isResult($item)) { - self::getApp()->internalRedirect('display/' . $item['guid']); + $baseURL->redirect('display/' . $item['guid']); } } }