fixes #2433: Automatic commentary copier doesn't account for html

This commit is contained in:
r888888888
2015-07-15 13:30:42 -07:00
parent 9f8e723d83
commit a10f30077b

View File

@@ -74,11 +74,15 @@ class UploadsController < ApplicationController
protected
def extract_artist_commentary(upload, data)
if data[:artist_commentary_desc]
upload.artist_commentary_title = data[:artist_commentary_title]
upload.artist_commentary_desc = data[:artist_commentary_desc]
upload.artist_commentary_title = strip_tags(data[:artist_commentary_title])
upload.artist_commentary_desc = strip_tags(data[:artist_commentary_desc])
end
end
def strip_tags(s)
HTML::FullSanitizer.new.sanitize(s)
end
def find_post_by_url(normalized_url)
if normalized_url.nil?
Post.where(source: params[:url]).first