diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-18 18:38:06 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-18 18:38:06 +0000 |
commit | b73350925fb884e9c89758f3ebf49fabc16f9f92 (patch) | |
tree | 20ff3b9a92209a5bd4529605955f55293b6dcd1b /engine/lib/entities.php | |
parent | 6dee5f10eb0e32a07020dfa42000f1a662792d33 (diff) | |
download | elgg-b73350925fb884e9c89758f3ebf49fabc16f9f92.tar.gz elgg-b73350925fb884e9c89758f3ebf49fabc16f9f92.tar.bz2 |
Container_guid is set intelligently for get_entities when owner_guid is set.
git-svn-id: https://code.elgg.org/elgg/trunk@1477 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 7d7551a3d..40d709fe3 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1189,14 +1189,19 @@ if ($subtype!=="") $where[] = "subtype=$subtype"; if ($owner_guid != "") { - if (!is_array($owner_guid)) { + if (!is_array($owner_guid)) {
+ $owner_array = array($owner_guid); $owner_guid = (int) $owner_guid; $where[] = "owner_guid = '$owner_guid'"; - } else if (sizeof($owner_guid) > 0) { + } else if (sizeof($owner_guid) > 0) {
+ $owner_array = $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})"; + }
+ if (is_null($container_guid)) {
+ $container_guid = array_merge(0,$owner_guid);
} } if ($site_guid > 0) |