mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: Uploaded files could not be oneboxed
This commit is contained in:
parent
706183f886
commit
694ee30e86
1 changed files with 19 additions and 0 deletions
|
@ -10,6 +10,25 @@ module Onebox
|
||||||
1
|
1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.===(other)
|
||||||
|
if other.kind_of?(URI)
|
||||||
|
uri = other
|
||||||
|
begin
|
||||||
|
route = Rails.application.routes.recognize_path(uri.path)
|
||||||
|
case route[:controller]
|
||||||
|
when 'topics'
|
||||||
|
true
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
rescue ActionController::RoutingError
|
||||||
|
false
|
||||||
|
end
|
||||||
|
else
|
||||||
|
super
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def to_html
|
def to_html
|
||||||
uri = URI::parse(@url)
|
uri = URI::parse(@url)
|
||||||
route = Rails.application.routes.recognize_path(uri.path)
|
route = Rails.application.routes.recognize_path(uri.path)
|
||||||
|
|
Loading…
Reference in a new issue