Skip to content

Commit

Permalink
Fixing the check on regular expression matches. The named group is <v…
Browse files Browse the repository at this point in the history
…ersion> not <ID> therefore the field have to be $matches['version'] to make a correct check
  • Loading branch information
Florian Henze authored and backportbot-libresign[bot] committed May 23, 2024
1 parent d7773c3 commit 5b002e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Service/Install/InstallService.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public function installJava(?bool $async = false): void {
private function getLinuxDistributionToDownloadJava(): string {
$distribution = shell_exec('cat /etc/*-release');
preg_match('/^ID=(?<version>.*)$/m', $distribution, $matches);
if (isset($matches['ID']) && strtolower($matches['ID']) === 'alpine') {
if (isset($matches['version']) && strtolower($matches['version']) === 'alpine') {
return 'alpine-linux';
}
return 'linux';
Expand Down

0 comments on commit 5b002e1

Please sign in to comment.