# Quoting across discourse instances with links getting process as local links

**URL:** https://meta.discourse.org/t/quoting-across-discourse-instances-with-links-getting-process-as-local-links/27889
**Category:** Bug
**Created:** [April 24, 2015, 2:14am UTC](https://meta.discourse.org/t/quoting-across-discourse-instances-with-links-getting-process-as-local-links/27889 "2015-04-24T02:14:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![anon25879736](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@anon25879736](https://meta.discourse.org/u/anon25879736)
#### Post date: [April 24, 2015, 2:14am UTC](https://meta.discourse.org/t/quoting-across-discourse-instances-with-links-getting-process-as-local-links/27889/1 "2015-04-24T02:14:20Z")

</div>

Before I get into this, I want to mention that I was going to try duplicating this on try.discourse, but it appears to be offline. Since I didn’t want to pollute things experimenting here, I’m just presenting what I found at WTDWTF.

Ok, basic description. Generally when quoting a post by using a link, you get pretty reliable results. However, when I have been trying to quote posts from here over at WTDWTF, I’ve been getting 1 of 2 results:

1. The topic ID and post number are parsed from the link, and then the relevant post from WTDWTF is wuoted instead of the post from here. [[Example](http://what.thedailywtf.com/t/meta-d-link-getting-baked-as-wtdwtf-link-and-displaying-a-wtdwtf-quote/48129?u=abarker)]
2. The link is left bare. Base on experimentation, it appears that this is because the corresponding topic at WTDWTF is restricted access, or the corresponding post does not exist. [[Example](http://what.thedailywtf.com/t/the-thread-of/1000/40503?u=abarker)]

Let’s see what happens here when I try to link to the corresponding bug report at WTDWTF:

> **[What the Daily WTF?](https://what.thedailywtf.com/login)**

---

<div class="post-metadata">

### Author: ![anon25879736](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@anon25879736](https://meta.discourse.org/u/anon25879736)
#### Post date: [April 24, 2015, 2:19am UTC](https://meta.discourse.org/t/quoting-across-discourse-instances-with-links-getting-process-as-local-links/27889/2 "2015-04-24T02:19:24Z")

</div>

> [@abarker](#):
>
> Let’s see what happens here when I try to link to the corresponding bug report at WTDWTF:

Looks like the link is bare because no corresponding topic exists here. Let’s try with a link to an older WTDWTF topic:

[http://what.thedailywtf.com/t/why-use-sql-when-you-can-do-it-by-hand/26672/5?u=abarker](http://what.thedailywtf.com/t/why-use-sql-when-you-can-do-it-by-hand/26672/5?u=abarker)

```plaintext
http://what.thedailywtf.com/t/why-use-sql-when-you-can-do-it-by-hand/26672/5?u=abarker

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 24, 2015, 2:27am UTC](https://meta.discourse.org/t/quoting-across-discourse-instances-with-links-getting-process-as-local-links/27889/3 "2015-04-24T02:27:31Z")

</div>

Well yeah because anons can’t see bug topics there, right? Hmm, no, I can get to that topic in incognito mode.

---

<div class="post-metadata">

### Author: ![anon25879736](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@anon25879736](https://meta.discourse.org/u/anon25879736)
#### Post date: [April 24, 2015, 2:32am UTC](https://meta.discourse.org/t/quoting-across-discourse-instances-with-links-getting-process-as-local-links/27889/4 "2015-04-24T02:32:10Z")

</div>

It seems that if the parser sees anything that resembles a discourse link, it just assumes that it is for the local instance. It just grabs the topic ID and post number and ignores the rest. For example, this won’t resolve at all: [https://chicken/t/pox/26672/2](https://chicken/t/pox/26672/2). But if you put it in a post for onebox quoting:

[https://chicken/t/pox/26672/2](https://chicken/t/pox/26672/2)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 24, 2015, 2:33am UTC](https://meta.discourse.org/t/quoting-across-discourse-instances-with-links-getting-process-as-local-links/27889/5 "2015-04-24T02:33:42Z")

</div>

I see that is much clearer probably a regression. @eviltrout you should add that to your list.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 24, 2015, 2:48am UTC](https://meta.discourse.org/t/quoting-across-discourse-instances-with-links-getting-process-as-local-links/27889/6 "2015-04-24T02:48:07Z")

</div>

~~Potentially~~ Definitely related to the change I just made?

[https://github.com/discourse/discourse/pull/3387/files#diff-5706007ce16fc2a1eb8526567e15dc0bR13](https://github.com/discourse/discourse/pull/3387/files#diff-5706007ce16fc2a1eb8526567e15dc0bR13)

> <https://github.com/discourse/discourse/blob/3681674ec4dfc01ace08276c224faad5dd2befe8/lib/onebox/engine/discourse_local_onebox.rb#L13-L30>

A fix might be to replace `true` with `super` - in that case, it’ll check for `Discourse.base_url` as well.

Or stick `return false unless super` at the start of the method.

* * *

Here’s a fix:

[https://github.com/discourse/discourse/pull/3395](https://github.com/discourse/discourse/pull/3395)

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 24, 2015, 8:11am UTC](https://meta.discourse.org/t/quoting-across-discourse-instances-with-links-getting-process-as-local-links/27889/7 "2015-04-24T08:11:39Z")

</div>


