Skip to content

Commit

Permalink
support compressed binary without hex encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
TrystanLea committed Dec 29, 2021
1 parent cd93d95 commit d9264ec
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Modules/input/input_methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,15 @@ public function post($userid)
public function bulk($userid)
{
global $param;

$data = $param->val('data');

if ($param->exists('c')) {
// data is compressed
if ($param->exists('cb')) {
// data is compressed binary format
$data = file_get_contents('php://input');
$data = gzuncompress($data);
} elseif ($param->exists('c')) {
// data is compressed hex format
$data = gzuncompress(hex2bin($data));
}

Expand Down

0 comments on commit d9264ec

Please sign in to comment.