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

Fix issue where linked sites break parked sites

This commit is contained in:
Adam Wathan
2017-02-22 08:37:43 -05:00
parent 2e0e2c1fa4
commit d1b62bed34

View File

@@ -63,13 +63,16 @@ function valet_support_xip_io($domain)
* Determine the fully qualified path to the site.
*/
$valetSitePath = null;
$domain = array_slice(explode('.', $siteName), -1)[0];
foreach ($valetConfig['paths'] as $path) {
$domain = ($pos = strrpos($siteName, '.')) !== false
? substr($siteName, $pos+1)
: null;
if (is_dir($path.'/'.$siteName) || is_dir($path.'/'.$domain)) {
$valetSitePath = $path.'/'.($domain ?: $siteName);
if (is_dir($path.'/'.$siteName)) {
$valetSitePath = $path.'/'.$siteName;
break;
}
if (is_dir($path.'/'.$domain)) {
$valetSitePath = $path.'/'.$domain;
break;
}
}