aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2012-01-01 19:29:17 -0500
committercash <cash.costello@gmail.com>2012-01-01 19:29:17 -0500
commite04c580e7064c24104f29a8aed295381c351b4a4 (patch)
tree7f559e2ed2b0aa461f0d1dd84030bc5a6d5ec246 /engine/lib
parentce691dd8c560abc48aaf578928d13dea6ef31565 (diff)
downloadelgg-e04c580e7064c24104f29a8aed295381c351b4a4.tar.gz
elgg-e04c580e7064c24104f29a8aed295381c351b4a4.tar.bz2
Fixes #3939 if user does not have permissions to see the name of the access collection, it is shown as "Limited"
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/access.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 08b9283cd..7be92fbfc 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -838,7 +838,7 @@ function elgg_list_entities_from_access_id(array $options = array()) {
*
* @param int $entity_access_id The entity's access id
*
- * @return string 'Public', 'Private', etc. or false if error.
+ * @return string 'Public', 'Private', etc.
* @since 1.7.0
* @todo I think this probably wants get_access_array() instead of get_write_access_array(),
* but those two functions return different types of arrays.
@@ -849,15 +849,12 @@ function get_readable_access_level($entity_access_id) {
//get the access level for object in readable string
$options = get_write_access_array();
- //@todo Really? Use array_key_exists()
- foreach ($options as $key => $option) {
- if ($key == $access) {
- $entity_acl = htmlentities($option, ENT_QUOTES, 'UTF-8');
- return $entity_acl;
- break;
- }
+ if (array_key_exists($access, $options)) {
+ return $options[$access];
}
- return false;
+
+ // return 'Limited' if the user does not have access to the access collection
+ return elgg_echo('access:limited:label');
}
/**