From a1d3c90fb72cd14f61b1209f9c0a0d3a106c71a8 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 7 Dec 2010 01:55:15 +0000 Subject: Refs #2220. Check that an autoload class is registered before trying to include it. git-svn-id: http://code.elgg.org/elgg/trunk@7552 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index e6bbb3c01..e8014f2a2 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -22,7 +22,7 @@ elgg_register_classes(dirname(dirname(__FILE__)) . '/classes'); function _elgg_autoload($class) { global $CONFIG; - if (!include($CONFIG->classes[$class])) { + if (!isset($CONFIG->classes[$class]) || !include($CONFIG->classes[$class])) { throw new Exception("Failed to autoload $class"); } } @@ -85,7 +85,7 @@ function elgg_register_library($name, $location) { /** * Load a php library. * - * @param string $name The name of the library + * @param string $name The name of the library * * @return void * @throws InvalidParameterException -- cgit v1.2.3