diff --git a/src/Model/Item.php b/src/Model/Item.php index 06c6252742..0c8b8b549d 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -14,6 +14,7 @@ use dba; require_once 'include/tags.php'; require_once 'include/threads.php'; +require_once 'include/items.php'; class Item { @@ -122,13 +123,11 @@ class Item $item = dba::selectFirst('item', [], ['id' => $itemid]); - if (count($item) && ($item["allow_cid"] == '') && ($item["allow_gid"] == '') && + if (DBM::is_result($item) && ($item["allow_cid"] == '') && ($item["allow_gid"] == '') && ($item["deny_cid"] == '') && ($item["deny_gid"] == '')) { if (!dba::exists('item', ['uri' => $item['uri'], 'uid' => 0])) { // Preparing public shadow (removing user specific data) - require_once("include/items.php"); - unset($item['id']); $item['uid'] = 0; $item['origin'] = 0; @@ -183,8 +182,6 @@ class Item } // Preparing public shadow (removing user specific data) - require_once("include/items.php"); - unset($item['id']); $item['uid'] = 0; $item['origin'] = 0;