YouTube titles with single quote(s) causes topic title to get cut off


(Colin Marshall) #1

To reproduce:

  1. Paste YouTube link with title containing single quote in new topic title field
    Example link: https://www.youtube.com/watch?v=L6EbORDmpNY
    YouTube Title: Colin Wolfe & ‘The Chronic’

  2. Fetched title cuts off at the first appearance of single quote.
    Discourse Title: Colin Wolfe &

In the source of that YouTube page, the title that Discourse is retrieving looks like this:

document.title = "Colin Wolfe \u0026 'The Chronic' - YouTube";

I’m guessing that the quote throws it off somewhere in here:


(Arpit Jalan) #3

I can’t repro this locally or on try. But as a precautionary measure we will now sanitize YouTube video title as per:


(Colin Marshall) #4

Are you pasting it in the Topic title field? I just tried it here and was able to reproduce.


(Arpit Jalan) #5

Ah, I missed that. Will repro and fix next week.


(Arpit Jalan) #6

Fixed via:

Thanks for reporting this issue @cmwebdev :+1:


(Arpit Jalan) #7

This topic was automatically closed after 6 hours. New replies are no longer allowed.