Skip to content
Snippets Groups Projects
Verified Commit 4b1fe4ea authored by 贾昊's avatar 贾昊
Browse files

bug fixed: Backends/ChinaNetOOS/ObjectDriver 支持文件名中的+号

parent 443cb129
Branches
Tags 0.8.5
No related merge requests found
Pipeline #85233 passed
......@@ -371,7 +371,10 @@ class ObjectDriver implements StorageObjectInterface
protected function url(string $path, string $type = self::ENDPOINT_URL_TYPE_NORMAL): string {
$encoded_path = explode('/', $path);
$encoded_path = array_map(function ($item) {
return str_replace('#', '%23', rawurlencode($item));
/**
* @note 在上传时文件名中的+被识别为了空格
*/
return str_replace(['#', '%2B'], ['%23', '+'], urlencode($item));
}, $encoded_path);
$path = implode('/', $encoded_path);
return "{$this->endpoint_url($type)}{$this->config->basedir}{$path}";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment