diff --git a/drush/includes/environment.inc b/drush/includes/environment.inc index 46af167..a43547b 100644 --- a/drush/includes/environment.inc +++ b/drush/includes/environment.inc @@ -240,8 +240,8 @@ function drush_site_path($path = NULL) { $site_path = $path; } else { - // Move up dir by dir and check each. - while ($path = _drush_shift_path_up($path)) { + // Move up dir by dir and check each. Also don't go above webroot. + while ($path != drush_get_context('DRUSH_DRUPAL_ROOT') && $path = _drush_shift_path_up($path) && $path) { if (file_exists($path . '/settings.php')) { $site_path = $path; break;