]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2781: Using same technique to check for full plugin path in ElggPlugin.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 7 Jan 2011 21:59:51 +0000 (21:59 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 7 Jan 2011 21:59:51 +0000 (21:59 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7859 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggPlugin.php

index 3352105f8f122f91b749251c045637893cec188b..142ccdf9858f263b11f1e6e1adb9c5d7e29b436e 100644 (file)
@@ -50,10 +50,12 @@ class ElggPlugin extends ElggObject {
                        parent::__construct($plugin);
                        $this->path = get_config('plugins_path') . $this->getID();
                } else {
+                       $plugin_path = elgg_get_plugin_path();
+
                        // not a full path, so assume an id
                        // use the default path
-                       if (substr($plugin, 0, 1) != '/') {
-                               $plugin = elgg_get_plugin_path() . $plugin;
+                       if (!strpos($plugin, $plugin_path) === 0) {
+                               $plugin = $plugin_path . $plugin;
                        }
 
                        // path checking is done in the package