]> git.mxchange.org Git - friendica.git/commitdiff
Ensure $item exists in mod/display
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 22 Dec 2019 14:00:16 +0000 (09:00 -0500)
committerGitHub <noreply@github.com>
Sun, 22 Dec 2019 14:00:16 +0000 (09:00 -0500)
- Addresses https://github.com/friendica/friendica/issues/7677#issuecomment-567575161

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.'));
        }