Merge pull request #7988 from friendica/MrPetovan-notice

Ensure $item exists in mod/display
This commit is contained in:
Philipp 2019-12-22 15:14:46 +01:00 committed by GitHub
commit 5c88777122
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.'));
}