aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/sites.php
diff options
context:
space:
mode:
authorEvan Winslow <evan@elgg.org>2012-10-09 20:51:36 -0700
committerEvan Winslow <evan@elgg.org>2012-10-09 20:51:36 -0700
commitca0f22f098bdac6982f30156884cf9f4c498c689 (patch)
tree8db3794fb2eed41e3a05f8c619e6b2ff34b71c97 /engine/lib/sites.php
parent84bf48937a7b294649701c1d6f4553dc0aeb4cd7 (diff)
parentddb3c10f7bbd0f0d78aafb5f858119160eb21f12 (diff)
downloadelgg-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.php12
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;
}
/**