Fix failed query

This commit is contained in:
Michael 2021-01-16 23:24:48 +00:00
parent d0174b57dd
commit e775be38c8

View File

@ -3470,7 +3470,7 @@ class Item
* *
* default permissions - anonymous user * default permissions - anonymous user
*/ */
$sql = sprintf(" AND `item`.`private` != %d", self::PRIVATE); $sql = sprintf(" AND `private` != %d", self::PRIVATE);
// Profile owner - everything is visible // Profile owner - everything is visible
if ($local_user && ($local_user == $owner_id)) { if ($local_user && ($local_user == $owner_id)) {
@ -3486,12 +3486,12 @@ class Item
$set = PermissionSet::get($owner_id, $remote_user); $set = PermissionSet::get($owner_id, $remote_user);
if (!empty($set)) { if (!empty($set)) {
$sql_set = sprintf(" OR (`item`.`private` = %d AND `item`.`wall` AND `item`.`psid` IN (", self::PRIVATE) . implode(',', $set) . "))"; $sql_set = sprintf(" OR (`private` = %d AND `wall` AND `psid` IN (", self::PRIVATE) . implode(',', $set) . "))";
} else { } else {
$sql_set = ''; $sql_set = '';
} }
$sql = sprintf(" AND (`item`.`private` != %d", self::PRIVATE) . $sql_set . ")"; $sql = sprintf(" AND (`private` != %d", self::PRIVATE) . $sql_set . ")";
} }
return $sql; return $sql;