Skip to content

Commit

Permalink
Fixed infinity loop when searching _ss_environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Zauberfisch committed Feb 17, 2015
1 parent 9a97cbc commit aa77e12
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@
//check this dir and every parent dir (until we hit the base of the drive)
// or until we hit a dir we can't read
while(true) {
//add the trailing slash we need to concatenate properly
$dir .= DIRECTORY_SEPARATOR;
//if it's readable, go ahead
if (@is_readable($dir)) {
//if the file exists, then we include it, set relevant vars and break out
if (file_exists($dir . $envFile)) {
define('SS_ENVIRONMENT_FILE', $dir . $envFile);
if (file_exists($dir . DIRECTORY_SEPARATOR . $envFile)) {
define('SS_ENVIRONMENT_FILE', $dir . DIRECTORY_SEPARATOR . $envFile);
include_once(SS_ENVIRONMENT_FILE);
//break out of BOTH loops because we found the $envFile
break(2);
Expand Down

0 comments on commit aa77e12

Please sign in to comment.