1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 08:40:09 +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:
Chris Brown
2018-08-22 13:40:32 -04:00
parent e5f9a6163a
commit a7d8f32073

View File

@@ -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();
}