mirror of
https://github.com/onionshare/onionshare.git
synced 2025-03-30 09:28:06 -04:00
Encode the file name when adding it to the 'link' attribute of each file.
This lets the file be downloaded if it has a special character e.g #.
This commit is contained in:
parent
6e05ee4426
commit
e425c643f5
@ -170,18 +170,18 @@ class SendBaseModeWeb:
|
||||
if is_dir:
|
||||
if add_trailing_slash:
|
||||
dirs.append(
|
||||
{"link": os.path.join(f"/{path}", filename, ""), "basename": filename}
|
||||
{"link": os.path.join(f"/{path}", quote(filename), ""), "basename": filename}
|
||||
)
|
||||
else:
|
||||
dirs.append(
|
||||
{"link": os.path.join(f"/{path}", filename), "basename": filename}
|
||||
{"link": os.path.join(f"/{path}", quote(filename)), "basename": filename}
|
||||
)
|
||||
else:
|
||||
size = os.path.getsize(this_filesystem_path)
|
||||
size_human = self.common.human_readable_filesize(size)
|
||||
files.append(
|
||||
{
|
||||
"link": os.path.join(f"/{path}", filename),
|
||||
"link": os.path.join(f"/{path}", quote(filename)),
|
||||
"basename": filename,
|
||||
"size_human": size_human,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user