1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 00:20: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()); $directory = $this->host(getcwd());
} }
$length = strlen('.'.$tld); // Remove .tld from the end of sitename if it was provided
if (substr($directory, -$length) === '.'.$tld) { if (ends_with($directory, '.'.$tld) {
$directory = substr($directory, 0, -$length); // Remove .tld from sitename if it was provided $directory = substr($directory, 0, -(strlen('.'.$tld)));
} }
if (! $this->parked()->merge($this->links())->where('site', $directory)->count() > 0) { if (! $this->parked()->merge($this->links())->where('site', $directory)->count() > 0) {