]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
Ensure $item exists in mod/display
[friendica.git] / mod / display.php
index b388b915e17a9b79c359ee6a957fe605c9769baf..de46cce0cb48f0e256ebd8681516f6fbb3f7c255 100644 (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.'));
        }