Browse Source

Merge pull request #12324 from cakephp/bugfix/realpath

Micro-opt and return type fix.
Mark Story 7 years ago
parent
commit
fe2a3aec5e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/Core/Configure/FileConfigTrait.php

+ 3 - 2
src/Core/Configure/FileConfigTrait.php

@@ -60,8 +60,9 @@ trait FileConfigTrait
             return $file;
         }
 
-        if (is_file(realpath($file))) {
-            return realpath($file);
+        $realPath = realpath($file);
+        if ($realPath !== false && is_file($realPath)) {
+            return $realPath;
         }
 
         throw new Exception(sprintf('Could not load configuration file: %s', $file));