From: brettp Date: Fri, 7 Jan 2011 22:00:33 +0000 (+0000) Subject: Refs #2781: Checking if a dir was passed as a plugin package. Need to do this to... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=101c850e6723d55759a6cf75965a2473ec2a55d5;p=lorea%2Felgg.git Refs #2781: Checking if a dir was passed as a plugin package. Need to do this to allow packages to be loaded outside of plugin_dir. git-svn-id: http://code.elgg.org/elgg/trunk@7860 36083f99-b078-4883-b0ff-0f9b5a30f544 --- diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php index c13345e67..74c8bd020 100644 --- a/engine/classes/ElggPluginPackage.php +++ b/engine/classes/ElggPluginPackage.php @@ -94,7 +94,9 @@ class ElggPluginPackage { */ public function __construct($plugin, $validate = true) { $plugin_path = elgg_get_plugin_path(); - if (strpos($plugin, $plugin_path) === 0) { + // @todo wanted to avoid another is_dir() call here. + // should do some profiling to see how much it affects + if (strpos($plugin, $plugin_path) === 0 || is_dir($plugin)) { // this is a path $path = sanitise_filepath($plugin);