diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-07 14:34:57 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-07 14:34:57 +0000 |
commit | eac45f9416be1b6caabb7ef00f78cb93234021a0 (patch) | |
tree | 3730a44fee8cfc2d256c8400c6e92ee9913660e3 /engine/classes | |
parent | 1d527097e116d130fdeb58871f040e6a30449ef2 (diff) | |
download | elgg-eac45f9416be1b6caabb7ef00f78cb93234021a0.tar.gz elgg-eac45f9416be1b6caabb7ef00f78cb93234021a0.tar.bz2 |
Refs #2781 path checking in ElggPluginPackage constructor should work for both *nix and Windows now
git-svn-id: http://code.elgg.org/elgg/trunk@7854 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes')
-rw-r--r-- | engine/classes/ElggPluginPackage.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php index 422f777b9..c13345e67 100644 --- a/engine/classes/ElggPluginPackage.php +++ b/engine/classes/ElggPluginPackage.php @@ -93,7 +93,8 @@ class ElggPluginPackage { * @throws PluginException */ public function __construct($plugin, $validate = true) { - if (substr($plugin, 0, 1) == '/') { + $plugin_path = elgg_get_plugin_path(); + if (strpos($plugin, $plugin_path) === 0) { // this is a path $path = sanitise_filepath($plugin); @@ -107,7 +108,7 @@ class ElggPluginPackage { throw new PluginException(elgg_echo('PluginException:InvalidID', array($plugin))); } - $path = get_config('pluginspath') . "$plugin/"; + $path = "{$plugin_path}$plugin/"; $id = $plugin; } @@ -198,6 +199,11 @@ class ElggPluginPackage { * @return bool */ private function isSaneDeps() { + // protection against plugins with no manifest file + if (!$this->getManifest()) { + return false; + } + $conflicts = $this->getManifest()->getConflicts(); $requires = $this->getManifest()->getRequires(); $provides = $this->getManifest()->getProvides(); |