mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 06:03:43 +08:00
DEV: Avoid using send
and make the method public instead.
This commit is contained in:
parent
0a06b3d977
commit
529e4018f0
|
@ -127,8 +127,6 @@ class PostAnalyzer
|
|||
raw_links.size
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def cooked_stripped
|
||||
@cooked_stripped ||= begin
|
||||
doc = Nokogiri::HTML.fragment(cook(@raw, topic_id: @topic_id))
|
||||
|
@ -137,6 +135,8 @@ class PostAnalyzer
|
|||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def link_is_a_mention?(l)
|
||||
html_class = l['class']
|
||||
return false if html_class.blank?
|
||||
|
|
|
@ -7,9 +7,8 @@ class UploadRecovery
|
|||
posts.where("raw LIKE '%upload:\/\/%'").find_each do |post|
|
||||
begin
|
||||
analyzer = PostAnalyzer.new(post.raw, post.topic_id)
|
||||
cooked_stripped = analyzer.send(:cooked_stripped)
|
||||
|
||||
cooked_stripped.css("img").each do |img|
|
||||
analyzer.cooked_stripped.css("img").each do |img|
|
||||
if dom_class = img["class"]
|
||||
if (Post.white_listed_image_classes & dom_class.split).count > 0
|
||||
next
|
||||
|
|
Loading…
Reference in New Issue
Block a user