Permalink
Browse files

fix(core): page owner entity only returns users/groups user can see

  • Loading branch information...
mrclay committed Sep 27, 2016
1 parent 78a3b97 commit 0d33310031024aa8940f9d3bbe5cdd80f2a4da57
Showing with 5 additions and 6 deletions.
  1. +5 −6 engine/lib/pageowner.php
@@ -44,19 +44,18 @@ function elgg_get_page_owner_guid($guid = 0) {
/**
* Gets the owner entity for the current page.
*
* @note Access is disabled when getting the page owner entity.
*
* @return \ElggUser|\ElggGroup|false The current page owner or false if none.
*
* @since 1.8.0
*/
function elgg_get_page_owner_entity() {
$guid = elgg_get_page_owner_guid();
if ($guid > 0) {
$ia = elgg_set_ignore_access(true);
$owner = get_entity($guid);
elgg_set_ignore_access($ia);
if (!$guid) {
return false;
}
$owner = get_entity($guid);
if ($owner instanceof ElggUser || $owner instanceof ElggGroup) {
return $owner;
}

0 comments on commit 0d33310

Please sign in to comment.