1
1
Fork 0

Ensure $item exists in mod/display

- Addresses https://github.com/friendica/friendica/issues/7677#issuecomment-567575161
This commit is contained in:
Hypolite Petovan 2019-12-22 09:00:16 -05:00 committed by GitHub
parent 1c499f498d
commit 637d526d6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -172,6 +172,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
$o = '';
$item = null;
if ($update) {
$item_id = $_REQUEST['item_id'];
$item = Item::selectFirst(['uid', 'parent', 'parent-uri'], ['id' => $item_id]);
@ -221,7 +223,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
}
}
if (!$item_id) {
if (empty($item)) {
throw new HTTPException\NotFoundException(L10n::t('The requested item doesn\'t exist or has been deleted.'));
}