no whitelist for catbus and fatcat

This commit is contained in:
Kyle Drake 2014-12-03 01:13:26 -08:00
parent 8bdf4e7663
commit 2a36bca4c0
4 changed files with 53 additions and 7 deletions

View file

@ -459,6 +459,11 @@ class Site < Sequel::Model
!username.empty? && username.match(/^[a-zA-Z0-9_\-]+$/i)
end
def okay_to_upload?(uploaded_file)
return true if [:catbus, :fatcat].include?(plan_type.to_sym)
self.class.valid_file_type?(uploaded_file)
end
def self.valid_file_type?(uploaded_file)
mime_type = Magic.guess_file_mime_type uploaded_file[:tempfile].path