mirror of
https://github.com/discourse/discourse.git
synced 2025-04-28 14:44:38 +08:00
FIX: internal links in subfolder installs
https://meta.discourse.org/t/links-arent-showing-in-the-sidebar-or-topic-summaries-on-subfolder-installs/41787/15
This commit is contained in:
parent
e15f0736cf
commit
9ca9fe729a
@ -123,9 +123,11 @@ class TopicLink < ActiveRecord::Base
|
|||||||
|
|
||||||
if Discourse.store.has_been_uploaded?(url)
|
if Discourse.store.has_been_uploaded?(url)
|
||||||
internal = Discourse.store.internal?
|
internal = Discourse.store.internal?
|
||||||
elsif parsed.host == Discourse.current_hostname || !parsed.host
|
elsif (parsed.host == Discourse.current_hostname && parsed.path.start_with?(Discourse.base_uri)) || !parsed.host
|
||||||
internal = true
|
internal = true
|
||||||
|
|
||||||
|
parsed.path.slice!(Discourse.base_uri)
|
||||||
|
|
||||||
route = Rails.application.routes.recognize_path(parsed.path)
|
route = Rails.application.routes.recognize_path(parsed.path)
|
||||||
|
|
||||||
# We aren't interested in tracking internal links to users
|
# We aren't interested in tracking internal links to users
|
||||||
|
Loading…
x
Reference in New Issue
Block a user