fix check bcmath, fix error proof when no bcmath

This commit is contained in:
qkqpttgf
2022-03-09 15:11:08 +08:00
committed by GitHub
parent ed631d958d
commit e16a7012ef
+6 -3
View File
@@ -573,7 +573,7 @@ class Aliyundrive {
} else { } else {
if (isset($_POST['CalcProof'])&&is_numeric($_POST['filesize'])) { if (isset($_POST['CalcProof'])&&is_numeric($_POST['filesize'])) {
// Calc proof code // Calc proof code
if (!function_exists('hexdec')) { if (!function_exists('bcadd')) {
// no php-bcmath // no php-bcmath
return output(0, 200); return output(0, 200);
} else { } else {
@@ -614,8 +614,11 @@ class Aliyundrive {
//error_log1($res['body']); //error_log1($res['body']);
$parent_file_id = json_decode($res['body'], true)['file_id']; $parent_file_id = json_decode($res['body'], true)['file_id'];
} }
//$response = $this->fileCreate($parent_file_id, $filename, $_POST['filesha1'], $fileinfo['size'], ceil($fileinfo['size']/$_POST['chunksize'])); if (!function_exists('bcadd')) {
$response = $this->fileCreate1($parent_file_id, $filename, $_POST['filesha1'], $_POST['proof_code'], $fileinfo['size'], ceil($fileinfo['size']/$_POST['chunksize'])); $response = $this->fileCreate($parent_file_id, $filename, $_POST['filesha1'], $fileinfo['size'], ceil($fileinfo['size']/$_POST['chunksize']));
} else {
$response = $this->fileCreate1($parent_file_id, $filename, $_POST['filesha1'], $_POST['proof_code'], $fileinfo['size'], ceil($fileinfo['size']/$_POST['chunksize']));
}
$res = json_decode($response['body'], true); $res = json_decode($response['body'], true);
if (isset($res['exist'])) { if (isset($res['exist'])) {
// 已经有 // 已经有