mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: Local onebox on subfolder installs
This should fix oneboxing local topics when using the subfolder install feature.
This commit is contained in:
parent
49d1f88f6e
commit
e51293d298
1 changed files with 2 additions and 2 deletions
|
@ -14,7 +14,7 @@ module Onebox
|
|||
if other.kind_of?(URI)
|
||||
uri = other
|
||||
begin
|
||||
route = Rails.application.routes.recognize_path(uri.path)
|
||||
route = Rails.application.routes.recognize_path(uri.path.sub(Discourse.base_uri, ""))
|
||||
case route[:controller]
|
||||
when 'uploads'
|
||||
super
|
||||
|
@ -34,7 +34,7 @@ module Onebox
|
|||
|
||||
def to_html
|
||||
uri = URI::parse(@url)
|
||||
route = Rails.application.routes.recognize_path(uri.path)
|
||||
route = Rails.application.routes.recognize_path(uri.path.sub(Discourse.base_uri, ""))
|
||||
url = @url.sub(/[&?]source_topic_id=(\d+)/, "")
|
||||
source_topic_id = $1.to_i
|
||||
|
||||
|
|
Loading…
Reference in a new issue