diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-10-08 20:35:10 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-10-08 20:35:10 -0400 |
commit | 5b0f0472efc28345d7a7398c3178b857b8f4091d (patch) | |
tree | 359e798aa64751ff494cde057f8966fdc4fa291a /engine/lib/entities.php | |
parent | 5e8e0700dbe1e933620f256443e7d18d258d7019 (diff) | |
download | elgg-5b0f0472efc28345d7a7398c3178b857b8f4091d.tar.gz elgg-5b0f0472efc28345d7a7398c3178b857b8f4091d.tar.bz2 |
Fixes #3943 returning false in can_write_to_container() if container does not exist
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index c94acbf08..78fa915dd 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -452,8 +452,10 @@ function can_write_to_container($user_guid = 0, $container_guid = 0, $type = 'al $container_guid = elgg_get_page_owner_guid(); } + $return = false; + if (!$container_guid) { - $return = TRUE; + $return = true; } $container = get_entity($container_guid); @@ -461,16 +463,16 @@ function can_write_to_container($user_guid = 0, $container_guid = 0, $type = 'al if ($container) { // If the user can edit the container, they can also write to it if ($container->canEdit($user_guid)) { - $return = TRUE; + $return = true; } // Basics, see if the user is a member of the group. // @todo this should be moved to the groups plugin/library if ($user && $container instanceof ElggGroup) { if (!$container->isMember($user)) { - $return = FALSE; + $return = false; } else { - $return = TRUE; + $return = true; } } } |