mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 00:40:06 +01:00
Fix merge error
The domain-name determination using strrpos wasn't very efficient. Stripping the `.crt` from the end of the filename is easier to parse. Now all it returns is the first part of the string up until the final `.`, treating the remainder as whatever tld was used for the domain, regardless of what tld valet is configured for.
This commit is contained in:
@@ -86,8 +86,8 @@ function getCertificates($path)
|
||||
return collect($this->files->scandir($path))->filter(function ($value, $key) {
|
||||
return ends_with($value, '.crt');
|
||||
})->map(function ($cert) {
|
||||
$tld = $this->config->read()['tld'];
|
||||
return substr($cert, 0, strripos($tld, '.', -5));
|
||||
$certWithoutSuffix = substr($cert, 0, -4);
|
||||
return substr($certWithoutSuffix, 0, strrpos($certWithoutSuffix, '.'));
|
||||
})->flip();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user