Skip to content

Commit d5e6f83

Browse files
hansfnweitzman
authored andcommitted
Fix infinite loop in DrupalBoot::scanUpForUri (on Windows) (#3435)
1 parent 3b1aba3 commit d5e6f83

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Boot/DrupalBoot.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ protected function scanUpForUri($root, $scan)
3434
if (file_exists("$scan/settings.php")) {
3535
return $scan;
3636
}
37-
$next = dirname($scan);
37+
// Use Path::getDirectory instead of dirname to
38+
// avoid certain bugs. Returns a canonicalized path.
39+
$next = Path::getDirectory($scan);
3840
if ($next == $scan) {
3941
return false;
4042
}
41-
$scan = Path::canonicalize($next);
43+
$scan = $next;
4244
if ($scan == $root) {
4345
return false;
4446
}

0 commit comments

Comments
 (0)