]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2781: Checking if a dir was passed as a plugin package. Need to do this to...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 7 Jan 2011 22:00:33 +0000 (22:00 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 7 Jan 2011 22:00:33 +0000 (22:00 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7860 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggPluginPackage.php

index c13345e67862f7a063a5a1ac4ab019e182634014..74c8bd0204cf07b3302922f40396249ce52e0168 100644 (file)
@@ -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);