`Topic#featured_link` containing more than just a valid URL


(Alan Tan) #1
  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?


(Stephen Chung) #2

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


(Alan Tan) #3

Nope Topic#featured_link gets stored as whatever the title is

[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"

(Stephen Chung) #4

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.


(Neil Lalonde) #5

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.


(Neil Lalonde) #6