# \`Topic#featured\_link\` containing more than just a valid URL

**URL:** https://meta.discourse.org/t/topic-featured-link-containing-more-than-just-a-valid-url/75302
**Category:** Bug
**Created:** [12월 4, 2017, 2:13오전 UTC](https://meta.discourse.org/t/topic-featured-link-containing-more-than-just-a-valid-url/75302 "2017-12-04T02:13:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [12월 4, 2017, 2:13오전 UTC](https://meta.discourse.org/t/topic-featured-link-containing-more-than-just-a-valid-url/75302/1 "2017-12-04T02:13:10Z")

</div>

1. Create topic and paste `https://meta.discourse.org test` into title
2. `Topic.last.featured_link` returns `https://meta.discourse.org test`.

@neil Can I confirm that the featured link feature is only activated when the title is a valid link only?

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [12월 4, 2017, 2:16오전 UTC](https://meta.discourse.org/t/topic-featured-link-containing-more-than-just-a-valid-url/75302/2 "2017-12-04T02:16:43Z")

</div>

Are you sure `https://meta.discourse.org test` is not interpreted as `https://meta.discourse.org%20test` or `https://meta.discourse.org+test`?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [12월 4, 2017, 2:18오전 UTC](https://meta.discourse.org/t/topic-featured-link-containing-more-than-just-a-valid-url/75302/3 "2017-12-04T02:18:36Z")

</div>

Nope `Topic#featured_link` gets stored as whatever the title is

```plaintext
[6] pry(main)> Topic.last.featured_link
  Topic Load (0.8ms) SELECT "topics".* FROM "topics" WHERE ("topics"."deleted_at" IS NULL) ORDER BY "topics"."id" DESC LIMIT 1
=> "https://meta.discourse.org yay"

```

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [12월 4, 2017, 2:20오전 UTC](https://meta.discourse.org/t/topic-featured-link-containing-more-than-just-a-valid-url/75302/4 "2017-12-04T02:20:52Z")

</div>

I mean maybe `https://meta.discourse.org yay` is a valid URL which is interpreted as `https://meta.discourse.org%20yay`.

EDIT: Type in `https://meta.discourse.org%20yay` into FireFox and it gets turned back into `https://meta.discourse.org yay` for display.

In Chrome, of course, it bounces straight to search via detecting two separate words for the domain name, meaning that Chrome doesn’t like spaces in domain names, but FireFox does.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [12월 4, 2017, 5:04오후 UTC](https://meta.discourse.org/t/topic-featured-link-containing-more-than-just-a-valid-url/75302/5 "2017-12-04T17:04:45Z")

</div>

It was a bug. It should not have turned the title into a featured link if it had something other than a url in it.

[https://github.com/discourse/discourse/commit/cde42c3f69dfb4e1b81bf48370ee54644e1be2d2](https://github.com/discourse/discourse/commit/cde42c3f69dfb4e1b81bf48370ee54644e1be2d2)

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [12월 4, 2017, 5:04오후 UTC](https://meta.discourse.org/t/topic-featured-link-containing-more-than-just-a-valid-url/75302/6 "2017-12-04T17:04:53Z")

</div>


