Skip to content

A platform for community discussion. Free, open, simple.

Fix the build.

Guo Xiang Tan9daed05ad0b6
diff --git a/app/jobs/regular/pull_hotlinked_images.rb b/app/jobs/regular/pull_hotlinked_images.rb
index fd5e4b7bf7f..de8bc07cbae 100644
--- a/app/jobs/regular/pull_hotlinked_images.rb
+++ b/app/jobs/regular/pull_hotlinked_images.rb
@@ -105,7 +105,7 @@ module Jobs
InlineUploads.match_img(raw, external_src: true, &replace_raw)
# BBCode tag - [img]http://...[/img]
- InlineUploads.match_bbcode_img(raw, &replace_raw)
+ InlineUploads.match_bbcode_img(raw, external_src: true, &replace_raw)
# Markdown linked image - [![alt](http://...)](http://...)
# Markdown inline - ![alt](http://...)
diff --git a/app/services/inline_uploads.rb b/app/services/inline_uploads.rb
index 60713c5739c..7d80fb8e84f 100644
--- a/app/services/inline_uploads.rb
+++ b/app/services/inline_uploads.rb
@@ -164,9 +164,9 @@ class InlineUploads
end
end
- def self.match_bbcode_img(markdown)
+ def self.match_bbcode_img(markdown, external_src: false)
markdown.scan(/(\[img\]\s?(.+)\s?\[\/img\])/) do |match|
- if matched_uploads(match[1]).present? && block_given?
+ if (matched_uploads(match[1]).present? && block_given?) || external_src
yield(match[0], match[1], +"![](#{PLACEHOLDER})", $~.offset(0)[0])
end
end