From d4da25a8f25fc79dda56c2103304ef497e1b4627 Mon Sep 17 00:00:00 2001 From: Hans Fredrik Nordhaug Date: Mon, 5 Mar 2018 21:36:11 +0100 Subject: [PATCH] Fix infinite loop in DrupalBoot::scanUpForUri (on Windows) --- src/Boot/DrupalBoot.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Boot/DrupalBoot.php b/src/Boot/DrupalBoot.php index 10403a16f2..974c1d8850 100644 --- a/src/Boot/DrupalBoot.php +++ b/src/Boot/DrupalBoot.php @@ -34,11 +34,13 @@ protected function scanUpForUri($root, $scan) if (file_exists("$scan/settings.php")) { return $scan; } - $next = dirname($scan); + // Use Path::getDirectory instead of dirname to + // avoid certain bugs. Returns a canonicalized path. + $next = Path::getDirectory($scan); if ($next == $scan) { return false; } - $scan = Path::canonicalize($next); + $scan = $next; if ($scan == $root) { return false; }