From: Philipp Holzer Date: Sat, 18 May 2019 18:37:37 +0000 (+0200) Subject: correct notice redirect X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d81c1d81b3388649ac85d65434ce75b66109e7e6;p=friendica.git correct notice redirect --- diff --git a/src/Model/ItemUser.php b/src/Model/ItemUser.php deleted file mode 100644 index c157150339..0000000000 --- a/src/Model/ItemUser.php +++ /dev/null @@ -1,36 +0,0 @@ - $id]); - if (empty($item)) { - return false; - } - - $user = DBA::selectFirst('user', $fields, ['uid' => $item['uid']]); - if (!empty($user)) { - return $user; - } else { - return false; - } - } -} diff --git a/src/Module/GnuSocial/Notice.php b/src/Module/GnuSocial/Notice.php index a364fa79f0..5df28a1f0d 100644 --- a/src/Module/GnuSocial/Notice.php +++ b/src/Module/GnuSocial/Notice.php @@ -4,6 +4,8 @@ namespace Friendica\Module\GnuSocial; use Friendica\BaseModule; use Friendica\Core\L10n; +use Friendica\Database\DBA; +use Friendica\Model\Item; use Friendica\Model\ItemUser; use Friendica\Network\HTTPException; @@ -23,12 +25,12 @@ class Notice extends BaseModule throw new HTTPException\NotFoundException(L10n::t('Item not found.')); } - $user = ItemUser::getUserForItemId($id, ['nickname']); + $item = DBA::selectFirst('item', ['guid'], ['id' => $id]); - if (empty($user)) { + if (empty($item )) { throw new HTTPException\NotFoundException(L10n::t('Item not found.')); } else { - $a->internalRedirect('display/' . $user['nickname'] . '/' . $id); + $a->internalRedirect('display/' . $item['guid']); } } }