Bug when quoting a private topic and discourse is not in basepath (duplicate prefix)

Follow-up / similar error to When moving posts to another thread AND discourse is not in basepath - prefix is missing in href:

Background / pre-requisities:

  1. I have a forum-installation in a subfolder (example.com/forum)

  2. I have a private category which only certain groups can access. A topic is created in one of these.

  3. I take a quote from one of these posts and copy it to a public topic.

Expected result:

  1. It should as now - correctly say: “In another topic” since it cannot / should not access the private topic.

  2. The link though, should go to the the topic so that users with access to the topic should be able to read it. I.e. path should be example.com/forum/t/XXX

Received result

  1. The path to the topic is example.com/forum/forum/t/XXXX

Additional info:

Here is

[quote="USERNAME, post:9, topic:68504"]
quoteed text

which is translated to:


but should be translated to


Live production example:


This should be fixed with this commit:


This topic was automatically closed after 3 days. New replies are no longer allowed.