fixes #2433: Automatic commentary copier doesn't account for html
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user