Skip to content

Commit

Permalink
set namespace as basename
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost committed Dec 22, 2023
1 parent b1b6063 commit d5050d9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cli/put.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ function _exec(
$argv[2]
);

// Get file name
$name = basename(
$argv[2]
);

// Check filename not longer of protocol
if (mb_strlen($name) > 255)
{
$name = $md5file;
}

// Split content to smaller parts, according to the protocol limits
$size = isset($argv[3]) && $argv[3] <= 3072 ? (int) $argv[3] : 3072;

Expand Down Expand Up @@ -66,7 +77,7 @@ function _exec(
sprintf(
"%s '%s'",
'keva_namespace',
$md5file
$name
)
);

Expand Down

0 comments on commit d5050d9

Please sign in to comment.