mirror of
https://github.com/friendica/friendica
synced 2025-04-19 09:50:11 +00:00
correct notice redirect
This commit is contained in:
parent
ce3b121064
commit
d81c1d81b3
2 changed files with 5 additions and 39 deletions
|
@ -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']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue