fix the build

This commit is contained in:
Régis Hanol 2017-10-23 19:09:38 +02:00 committed by GitHub
parent 80ad32094d
commit 17e5fb0dc0
1 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ class CookedPostProcessor
post_process_oneboxes post_process_oneboxes
optimize_urls optimize_urls
update_post_image update_post_image
enforce_no_follow enforce_nofollow
pull_hotlinked_images(bypass_bump) pull_hotlinked_images(bypass_bump)
grant_badges grant_badges
DiscourseEvent.trigger(:post_process_cooked, @doc, @post) DiscourseEvent.trigger(:post_process_cooked, @doc, @post)
@ -314,14 +314,14 @@ class CookedPostProcessor
@has_oneboxes = true @has_oneboxes = true
Oneboxer.onebox(url, args) Oneboxer.onebox(url, args)
end end
uploads = oneboxed_image_uploads.select(:url, :origin) uploads = oneboxed_image_uploads.select(:url, :origin)
oneboxed_images.each do |img| oneboxed_images.each do |img|
url = img["src"].sub(/^https?:/i, "") url = img["src"].sub(/^https?:/i, "")
upload = uploads.find { |u| u.origin.sub(/^https?:/i, "") == url } upload = uploads.find { |u| u.origin.sub(/^https?:/i, "") == url }
img["src"] = upload.url if upload.present? img["src"] = upload.url if upload.present?
end end
# make sure we grab dimensions for oneboxed images # make sure we grab dimensions for oneboxed images
oneboxed_images.each { |img| limit_size!(img) } oneboxed_images.each { |img| limit_size!(img) }
end end
@ -351,7 +351,7 @@ class CookedPostProcessor
img["src"] = Discourse.store.cdn_url(img["src"]) if use_s3_cdn img["src"] = Discourse.store.cdn_url(img["src"]) if use_s3_cdn
end end
end end
def enforce_nofollow def enforce_nofollow
if !@cooking_options[:omit_nofollow] && SiteSetting.add_rel_nofollow_to_user_content if !@cooking_options[:omit_nofollow] && SiteSetting.add_rel_nofollow_to_user_content
PrettyText.add_rel_nofollow_to_user_content(@doc) PrettyText.add_rel_nofollow_to_user_content(@doc)