Skip to content

Commit

Permalink
Merge pull request #242 from MalloZup/alpha-15
Browse files Browse the repository at this point in the history
sanitize filenames
  • Loading branch information
MalloZup authored Mar 2, 2021
2 parents b0e2a8b + de5e6e5 commit dc7ce1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hawk/app/models/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ class Upload < Tableless
errors.add(:upload, _("must have correct MIME type (was %s)") % record.upload.content_type)
end

unless record.upload.original_filename =~ /\.tar\.(bz2|gz|xz)\z/
errors.add(:upload, _("must have correct file extension"))
unless record.upload.original_filename =~ /^[a-zA-Z0-9_-]+\.tar\.(bz2|gz|xz)\z/
errors.add(:upload, _("must have correct file extension or right alphanumeric chars"))
end
end

Expand Down

0 comments on commit dc7ce1d

Please sign in to comment.