mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
check file types with lowercase
This commit is contained in:
parent
5884b6aaaa
commit
fdd4017523
1 changed files with 1 additions and 1 deletions
2
app.rb
2
app.rb
|
@ -307,7 +307,7 @@ post '/site_files/upload' do
|
|||
|
||||
mime_type = Magic.guess_file_mime_type params[:newfile][:tempfile].path
|
||||
|
||||
unless (Site::VALID_MIME_TYPES.include?(mime_type) || mime_type =~ /text/) && Site::VALID_EXTENSIONS.include?(File.extname(params[:newfile][:filename]).sub(/^./, ''))
|
||||
unless (Site::VALID_MIME_TYPES.include?(mime_type) || mime_type =~ /text/) && Site::VALID_EXTENSIONS.include?(File.extname(params[:newfile][:filename]).sub(/^./, '').downcase)
|
||||
@errors << 'File must me one of the following: HTML, Text, Image (JPG PNG GIF JPEG SVG), JS, CSS, Markdown.'
|
||||
halt http_error_code, 'File type is not supported.' # slim(:'site_files/new')
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue