Plugin system update

This commit is contained in:
bergware
2022-06-29 09:37:52 +02:00
parent 0af8cfcc1d
commit 088202d727
@@ -305,13 +305,8 @@ function plugin($method, $plugin_file, &$error) {
@unlink($name);
return false;
}
if ($file->SHA256 && hash_file('sha256', $name) != $file->SHA256) {
$error = "bad file SHA256";
@unlink($name);
return false;
}
if ($file->MD5 && md5_file($name) != $file->MD5) {
$error = "bad file MD5";
if (($file->SHA256 && hash_file('sha256',$name) != $file->SHA256) or ($file->MD5 && md5_file($name) != $file->MD5)) {
$error = "bad hash value";
@unlink($name);
return false;
}