From 142790c977654befcefbb5a3ef0b39414e820d24 Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 13 Jun 2008 10:23:20 +0000 Subject: Marcus Povey: CLOSED - # 9: FilePluginFile not found http://trac.elgg.org/ticket/9 git-svn-id: https://code.elgg.org/elgg/trunk@908 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/database.php | 2 +- engine/lib/entities.php | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'engine') diff --git a/engine/lib/database.php b/engine/lib/database.php index 62fa15877..d3113e202 100644 --- a/engine/lib/database.php +++ b/engine/lib/database.php @@ -148,7 +148,7 @@ if (!empty($callback) && is_callable($callback)) { $row = $callback($row); } - $resultarray[] = $row; + if ($row) $resultarray[] = $row; } } diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 998b996de..7266ed723 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -962,12 +962,17 @@ $classname = get_subtype_class_from_id($row->subtype); if ($classname!="") { - $tmp = new $classname($row); - - if (!($tmp instanceof ElggEntity)) - throw new ClassException(sprintf(elgg_echo('ClassException:ClassnameNotClass'), $classname, get_class())); - - return $tmp; + if (class_exists($classname)) + { + $tmp = new $classname($row); + + if (!($tmp instanceof ElggEntity)) + throw new ClassException(sprintf(elgg_echo('ClassException:ClassnameNotClass'), $classname, get_class())); + + return $tmp; + } + else + error_log(sprintf(elgg_echo('ClassNotFoundException:MissingClass'), $classname)); } else { -- cgit v1.2.3