From 637d526d6a45632b8d4b54b0afa148b94af0ddb6 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 22 Dec 2019 09:00:16 -0500 Subject: [PATCH] Ensure $item exists in mod/display - Addresses https://github.com/friendica/friendica/issues/7677#issuecomment-567575161 --- mod/display.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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.')); }