Skip to content

Commit

Permalink
Now accepts all hashing algorithms reported by hash_algos()
Browse files Browse the repository at this point in the history
  • Loading branch information
TCB13 committed Dec 19, 2018
1 parent 94baf00 commit f8f22ab
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ class Server
{

const PROTOCOL_VERSION = "1.0.0";
const CHECKSUM_ALGORITHMS = [
"crc32",
"md5",
"sha1",
"sha256",
"sha512",
];

protected $uploadMaxFileSize = 50000000;
protected $uploadDir = null;
Expand Down Expand Up @@ -329,7 +322,7 @@ protected static function parseChecksum(string $value = "")
return false;

$value = \explode(" ", $value);
if (empty($value) || !\in_array($value[0], self::CHECKSUM_ALGORITHMS) || !isset($value[1]))
if (empty($value) || !\in_array($value[0], hash_algos()) || !isset($value[1]))
return false;

$checksum = new \stdClass();
Expand Down

0 comments on commit f8f22ab

Please sign in to comment.