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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user