From: brettp Date: Tue, 7 Dec 2010 01:55:15 +0000 (+0000) Subject: Refs #2220. Check that an autoload class is registered before trying to include it. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=a1d3c90fb72cd14f61b1209f9c0a0d3a106c71a8;p=lorea%2Felgg.git 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 --- 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