diff options
-rw-r--r-- | engine/lib/entities.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 161ba5487..97518e886 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1007,12 +1007,14 @@ global $CONFIG;
$user_guid = (int)$user_guid;
- if (!$user_guid) $user_guid = $_SESSION['user']->getGUID();
+ if (!$user_guid) $user_guid = (int) $_SESSION['guid'];
$user = get_entity($user_guid);
$container_guid = (int)$container_guid;
if (!$container_guid) $container_guid = page_owner();
+ if (!$container_guid) return true;
+
$container = get_entity($container_guid);
if (($container) && ($user))
@@ -1192,13 +1194,13 @@ if (!is_array($owner_guid)) {
$owner_array = array($owner_guid); $owner_guid = (int) $owner_guid; - $where[] = "owner_guid = '$owner_guid'"; + // $where[] = "owner_guid = '$owner_guid'"; } else if (sizeof($owner_guid) > 0) {
- $owner_array = $owner_guid; + $owner_array = array_map('sanitise_int', $owner_guid); // Cast every element to the owner_guid array to int - $owner_guid = array_map("sanitise_int", $owner_guid); - $owner_guid = implode(",",$owner_guid); - $where[] = "owner_guid in ({$owner_guid})"; + // $owner_guid = array_map("sanitise_int", $owner_guid); + // $owner_guid = implode(",",$owner_guid); + // $where[] = "owner_guid in ({$owner_guid})"; }
if (is_null($container_guid)) {
$container_guid = $owner_array;
|