Browse Source

Fixes #8054

Added a check first for the path to cakephp-plugins.php file will not go beyond the application in standalone one library.

The check for second one is made for framework.
Hari K T 10 years ago
parent
commit
964b4beef4
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/Core/Plugin.php

+ 6 - 4
src/Core/Plugin.php

@@ -185,11 +185,13 @@ class Plugin
         if (Configure::check('plugins')) {
             return;
         }
-
-        $vendorFile = dirname(dirname(dirname(dirname(__DIR__)))) . DS . 'cakephp-plugins.php';
+        $vendorFile = dirname(dirname(__DIR__)) . DS . 'cakephp-plugins.php';
         if (!file_exists($vendorFile)) {
-            Configure::write(['plugins' => []]);
-            return;
+            $vendorFile = dirname(dirname(dirname(dirname(__DIR__)))) . DS . 'cakephp-plugins.php';
+            if (!file_exists($vendorFile)) {
+                Configure::write(['plugins' => []]);
+                return;
+            }
         }
 
         $config = require $vendorFile;