From 101c850e6723d55759a6cf75965a2473ec2a55d5 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 7 Jan 2011 22:00:33 +0000 Subject: 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 --- engine/classes/ElggPluginPackage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engine') 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); -- cgit v1.2.3