Updated stubs, improved PHP7 compatibility
This commit is contained in:
@ -57,6 +57,7 @@ class Hotfix
|
||||
break;
|
||||
case 'php':
|
||||
$exec = "/usr/bin/env php";
|
||||
$head = "<?php require_once \"".__DIR__."/../../vendor/autoload.php\"; ".file_get_contents(__DIR__."/../stubs/php.stub");
|
||||
break;
|
||||
default:
|
||||
fprintf(STDERR, "Error: Unsupported language %s\n", $lang);
|
||||
|
@ -44,7 +44,11 @@ class Loader
|
||||
} else {
|
||||
list ($body, $signature) = explode($sigHeader, $hotfix);
|
||||
$signature = $sigHeader.$signature;
|
||||
$signer = $this->verifySignature($body, $signature);
|
||||
if (!$insecure) {
|
||||
$signer = $this->verifySignature($body, $signature);
|
||||
} else {
|
||||
$signer = null;
|
||||
}
|
||||
}
|
||||
return new Hotfix($body, $signer);
|
||||
}
|
||||
@ -64,6 +68,10 @@ class Loader
|
||||
$fingerprint = $sigInfo[0]['fingerprint'];
|
||||
$keyInfo = gnupg_keyinfo($gpg, $fingerprint);
|
||||
|
||||
if (empty($keyInfo)) {
|
||||
throw new \Exception("Unknown signer (key id {$sigInfo[0]['fingerprint']})");
|
||||
}
|
||||
|
||||
$subKeys = $keyInfo[0]['subkeys'];
|
||||
$keyId = null;
|
||||
foreach ($subKeys as $subKey) {
|
||||
@ -73,10 +81,6 @@ class Loader
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($keyInfo)) {
|
||||
throw new \Exception("Unknown signer (key id {$sigInfo[0]['fingerprint']})");
|
||||
}
|
||||
|
||||
return [ $keyInfo[0], $keyId ];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user