From 2612c81c6fa8b2e5fc548b01e11eae47c8f2e72e Mon Sep 17 00:00:00 2001 From: icewing Date: Fri, 14 Mar 2008 10:45:02 +0000 Subject: Marcus Povey * Belts and braces git-svn-id: https://code.elgg.org/elgg/trunk@216 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/sites.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engine/lib/sites.php') diff --git a/engine/lib/sites.php b/engine/lib/sites.php index 2a88deff1..6dfbb3063 100644 --- a/engine/lib/sites.php +++ b/engine/lib/sites.php @@ -100,10 +100,14 @@ error_log("Creating by $guid"); // Test to see if we have the generic stuff if (!parent::load($guid)) return false; + + // Check the type + if ($this->attributes['type']!='site') + throw new InvalidClassException("GUID:$guid is not a valid ElggSite"); // Load missing data $row = get_site_entity_as_row($guid); - + // Now put these into the attributes array as core values $objarray = (array) $row; foreach($objarray as $key => $value) -- cgit v1.2.3