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

Update cli/Valet/Site.php

Co-authored-by: Matt Stauffer <mattstauffer@users.noreply.github.com>
This commit is contained in:
Erik Dohmen
2022-11-11 09:37:38 +01:00
committed by GitHub
parent 2d429c353d
commit 753f2db745

View File

@@ -208,9 +208,9 @@ public function getSiteUrl($directory)
$directory = $this->host(getcwd());
}
$length = strlen('.'.$tld);
if (substr($directory, -$length) === '.'.$tld) {
$directory = substr($directory, 0, -$length); // Remove .tld from sitename if it was provided
// Remove .tld from the end of sitename if it was provided
if (ends_with($directory, '.'.$tld) {
$directory = substr($directory, 0, -(strlen('.'.$tld)));
}
if (! $this->parked()->merge($this->links())->where('site', $directory)->count() > 0) {