From: Hypolite Petovan Date: Sun, 22 Dec 2019 14:00:16 +0000 (-0500) Subject: Ensure $item exists in mod/display X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=637d526d6a45632b8d4b54b0afa148b94af0ddb6;hp=1c499f498da7085dff73d709214b153d1249a454;p=friendica.git Ensure $item exists in mod/display - Addresses https://github.com/friendica/friendica/issues/7677#issuecomment-567575161 --- diff --git a/mod/display.php b/mod/display.php index b388b915e1..de46cce0cb 100644 --- a/mod/display.php +++ b/mod/display.php @@ -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.')); }