Browse Source

Fix: Do not load cakephp-plugins from outside of ROOT

Running tests on a vendor installed cakephp will cause plugins from its
app to be loaded.
Rachman Chavik 8 years ago
parent
commit
1597e6f47c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Core/Plugin.php

+ 1 - 1
src/Core/Plugin.php

@@ -189,7 +189,7 @@ class Plugin
         $vendorFile = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'cakephp-plugins.php';
         if (!file_exists($vendorFile)) {
             $vendorFile = dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'cakephp-plugins.php';
-            if (!file_exists($vendorFile)) {
+            if (strpos(ROOT, $vendorFile) === false || !file_exists($vendorFile)) {
                 Configure::write(['plugins' => []]);
 
                 return;