From 9331dfa63cb87d146afb3db52ffa3561f2f18acc Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 28 Jan 2016 15:45:10 -0500 Subject: [PATCH] category export: export img src with absolute urls so pull_hotlink_image can move it over later --- lib/import_export/topic_exporter.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/import_export/topic_exporter.rb b/lib/import_export/topic_exporter.rb index 962416c2488..78b4dc4d9eb 100644 --- a/lib/import_export/topic_exporter.rb +++ b/lib/import_export/topic_exporter.rb @@ -71,7 +71,9 @@ module ImportExport topic_data[:posts] = [] topic.ordered_posts.find_each do |post| - topic_data[:posts] << POST_ATTRS.inject({}) { |h, a| h[a] = post.send(a); h; } + h = POST_ATTRS.inject({}) { |h, a| h[a] = post.send(a); h; } + h[:raw] = h[:raw].gsub('src="/uploads', "src=\"#{Discourse.base_url_no_prefix}/uploads") + topic_data[:posts] << h end @export_data[:topics] << topic_data