Stricter sanitization rules for download filenames

Fixes #212
This commit is contained in:
Alex Ling 2021-09-06 12:58:48 +00:00
parent da8a485087
commit 60a126024c

View File

@ -24,8 +24,9 @@ class Plugin
end
private def process_filename(str)
return "_" if str == ".."
str.gsub "/", "_"
str
.gsub(/[\/\s\.\177\000-\031]/, "_")
.gsub(/__+/, "_")
end
private def download(job : Queue::Job)