mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #3910 from Zauberfisch/patch-5
Fixed infinity loop when searching _ss_environment
This commit is contained in:
commit
4b7a91569c
@ -50,13 +50,11 @@ foreach ($dirsToCheck as $dir) {
|
|||||||
//check this dir and every parent dir (until we hit the base of the drive)
|
//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
|
// or until we hit a dir we can't read
|
||||||
while(true) {
|
while(true) {
|
||||||
//add the trailing slash we need to concatenate properly
|
|
||||||
$dir .= DIRECTORY_SEPARATOR;
|
|
||||||
//if it's readable, go ahead
|
//if it's readable, go ahead
|
||||||
if (@is_readable($dir)) {
|
if (@is_readable($dir)) {
|
||||||
//if the file exists, then we include it, set relevant vars and break out
|
//if the file exists, then we include it, set relevant vars and break out
|
||||||
if (file_exists($dir . $envFile)) {
|
if (file_exists($dir . DIRECTORY_SEPARATOR . $envFile)) {
|
||||||
define('SS_ENVIRONMENT_FILE', $dir . $envFile);
|
define('SS_ENVIRONMENT_FILE', $dir . DIRECTORY_SEPARATOR . $envFile);
|
||||||
include_once(SS_ENVIRONMENT_FILE);
|
include_once(SS_ENVIRONMENT_FILE);
|
||||||
//break out of BOTH loops because we found the $envFile
|
//break out of BOTH loops because we found the $envFile
|
||||||
break(2);
|
break(2);
|
||||||
|
Loading…
Reference in New Issue
Block a user