diff options
author | Evan Winslow <evan@elgg.org> | 2012-10-09 20:51:36 -0700 |
---|---|---|
committer | Evan Winslow <evan@elgg.org> | 2012-10-09 20:51:36 -0700 |
commit | ca0f22f098bdac6982f30156884cf9f4c498c689 (patch) | |
tree | 8db3794fb2eed41e3a05f8c619e6b2ff34b71c97 /engine/lib/sites.php | |
parent | 84bf48937a7b294649701c1d6f4553dc0aeb4cd7 (diff) | |
parent | ddb3c10f7bbd0f0d78aafb5f858119160eb21f12 (diff) | |
download | elgg-ca0f22f098bdac6982f30156884cf9f4c498c689.tar.gz elgg-ca0f22f098bdac6982f30156884cf9f4c498c689.tar.bz2 |
Merge pull request #387 from jeabakker/#4868
#4868 - possible unexpected result from elgg_get_site_entity
Diffstat (limited to 'engine/lib/sites.php')
-rw-r--r-- | engine/lib/sites.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php index 850092cad..8b772668d 100644 --- a/engine/lib/sites.php +++ b/engine/lib/sites.php @@ -18,11 +18,19 @@ function elgg_get_site_entity($site_guid = 0) { global $CONFIG; + $result = false; + if ($site_guid == 0) { - return $CONFIG->site; + $site = $CONFIG->site; + } else { + $site = get_entity($site_guid); + } + + if($site instanceof ElggSite){ + $result = $site; } - return get_entity($site_guid); + return $result; } /** |