Merge branch 'add-list-of-authorized-extensions' of git://github.com/ZogStriP/discourse into ZogStriP-add-list-of-authorized-extensions

Conflicts:
	app/models/site_setting.rb
This commit is contained in:
Robin Ward
2013-07-03 11:18:42 -04:00
21 changed files with 69 additions and 53 deletions

View File

@ -51,6 +51,7 @@ class SiteSetting < ActiveRecord::Base
setting(:title_prettify, true)
client_setting(:max_upload_size_kb, 2048)
client_setting(:authorized_extensions, '.jpg|.jpeg|.png|.gif')
# settings only available server side
setting(:auto_track_topics_after, 240000)

View File

@ -69,7 +69,7 @@ class Upload < ActiveRecord::Base
# make sure we're at the beginning of the file (FastImage is moving the pointer)
file.rewind
# store the file and update its url
upload.url = Upload.store_file(file, sha1, image_info, upload.id)
upload.url = Upload.store_file(file, sha1, image_info, upload.id)
# save the url
upload.save
end