Fix for nonstandard file rename with supporter accounts

This commit is contained in:
Kyle Drake 2021-09-09 17:51:47 -05:00
parent fea2ec55f9
commit f5613d2776
2 changed files with 15 additions and 1 deletions

View file

@ -56,7 +56,9 @@ class SiteFile < Sequel::Model
mime_type = Magic.guess_file_mime_type site.files_path(self.path)
extname = File.extname new_path
return false, 'unsupported file type' unless site.class.valid_file_mime_type_and_ext?(mime_type, extname)
unless site.supporter? || site.class.valid_file_mime_type_and_ext?(mime_type, extname)
return false, 'unsupported file type'
end
end
begin