diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 65ed35bc2c468f38149278bda827ef6a1ca92228..b475adb53fddedf8cbf1a3a03cedc9d3c7230b77 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -404,7 +404,7 @@ public static function findSitePath(Request $request, $require_settings = TRUE, // Determine whether multi-site functionality is enabled. If not, return // the default directory. - if (!file_exists($app_root . '/sites/sites.php')) { + if (!is_file($app_root . '/sites/sites.php')) { return 'sites/default'; } @@ -435,10 +435,10 @@ public static function findSitePath(Request $request, $require_settings = TRUE, // If the identifier is a key in $sites, check for a directory matching // the corresponding value. Otherwise, check for a directory matching // the identifier. - if (isset($sites[$site_id]) && file_exists($app_root . '/sites/' . $sites[$site_id])) { + if (isset($sites[$site_id]) && is_dir($app_root . '/sites/' . $sites[$site_id])) { $site_id = $sites[$site_id]; } - if (file_exists($app_root . '/sites/' . $site_id . '/settings.php') || (!$require_settings && file_exists($app_root . '/sites/' . $site_id))) { + if (is_file($app_root . '/sites/' . $site_id . '/settings.php') || (!$require_settings && is_file($app_root . '/sites/' . $site_id))) { return "sites/$site_id"; } } @@ -649,7 +649,7 @@ public function discoverServiceProviders() { $this->serviceProviderClasses['app'][$module] = $class; } $filename = dirname($filename) . "/$module.services.yml"; - if (file_exists($filename)) { + if (is_file($filename)) { $this->serviceYamls['app'][$module] = $filename; } } @@ -1663,7 +1663,7 @@ protected static function setupTrustedHosts(Request $request, $host_patterns) { * A list of service files. */ protected function addServiceFiles(array $service_yamls) { - $this->serviceYamls['site'] = array_filter($service_yamls, 'file_exists'); + $this->serviceYamls['site'] = array_filter($service_yamls, 'is_file'); } /**