mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Old Upload#url scheme support for Upload.get_from_url.
This is for backwards compatibility purposes. Even if `Upload#url` has a format that we don't recognize, we should still return the upload object as long as the upload record is present.
This commit is contained in:
@@ -26,7 +26,13 @@ module HasUrl
|
||||
|
||||
return if uri&.path.blank?
|
||||
data = extract_url(uri.path)
|
||||
return if data.blank?
|
||||
|
||||
if data.blank?
|
||||
result = nil
|
||||
result ||= self.find_by(url: uri.path)
|
||||
return result
|
||||
end
|
||||
|
||||
result = nil
|
||||
|
||||
if self.name == "Upload"
|
||||
|
||||
Reference in New Issue
Block a user