1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-07 09:10:03 +01:00

Fix bug with certificate search for TLDs of other than 3 chars

The `substr` of `-8` was based on `.dev.crt`, but since the TLD has always been configurable, this should have always been dynamic.

Running `valet links` will not show `https` or the `TLS` columns correctly if the substring matching is of the wrong length.
This commit is contained in:
Chris Brown
2017-10-17 20:33:39 -04:00
parent 58e4645fe2
commit 3f1c5fae60

View File

@@ -85,7 +85,8 @@ function getCertificates($path)
return collect($this->files->scanDir($path))->filter(function ($value, $key) {
return ends_with($value, '.crt');
})->map(function ($cert) {
return substr($cert, 0, -8);
$tld = $this->config->read()['tld'];
return substr($cert, 0, -(strlen($tld)+5));
})->flip();
}