1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

Check if index.php exists in the localized folder

This commit is contained in:
Martin Leveille
2018-03-25 12:02:16 -04:00
parent 567d38eafe
commit 49173c0c40

View File

@@ -191,8 +191,13 @@ public function frontControllerPath($sitePath, $siteName, $uri)
$parts = explode('/', $uri);
if (count($parts) > 1 && in_array($parts[1], $locales)) {
$indexPath = $sitePath.'/'.$frontControllerDirectory.'/'.$parts[1].'/index.php';
$scriptName = '/'.$parts[1].'/index.php';
$indexLocalizedPath = $sitePath.'/'.$frontControllerDirectory.'/'.$parts[1].'/index.php';
// Check if index.php exists in the localized folder, this is optional in Craft 3
if (file_exists($indexLocalizedPath)) {
$indexPath = $indexLocalizedPath;
$scriptName = '/'.$parts[1].'/index.php';
}
}
$_SERVER['SCRIPT_FILENAME'] = $indexPath;