mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Fix regression due to 914ada1c74.
This commit is contained in:
@@ -17,8 +17,10 @@ module HasUrl
|
||||
return if uri&.path.blank?
|
||||
data = extract_url(uri.path)
|
||||
return if data.blank?
|
||||
|
||||
self.find_by("url LIKE ?", "%#{data[1]}")
|
||||
sha1 = data[2]
|
||||
result = nil
|
||||
result = self.find_by(sha1: sha1) if sha1&.length == Upload::SHA1_LENGTH
|
||||
result || self.find_by("url LIKE ?", "%#{data[1]}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user