From dbaf98412f85ae9e1d81bf543f3aca09eb2cacc8 Mon Sep 17 00:00:00 2001 From: Sesamestrong Date: Sun, 20 Oct 2019 19:24:55 -0400 Subject: [PATCH] Sanitize urls with single quotation marks This fixes behavior for URLs with single quotes within them. The behavior for a url like `https://severalglamorousthing.426729.repl.co/google's%20logo.png` would be no background at all; the CSS rule would change to `background-image: url((unknown));`. This fixes the problem and adds `\` to every `'` in the image url. The behavior of the repo with this fix would be a conversion of the url provided above to `https://severalglamorousthing.426729.repl.co/google\'s%20logo.png`, which can be put into `\`url('${url}')\`` without breaking the CSS rule. --- src/ui/component/cardMedia/view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/component/cardMedia/view.jsx b/src/ui/component/cardMedia/view.jsx index d976ec151..58f71a969 100644 --- a/src/ui/component/cardMedia/view.jsx +++ b/src/ui/component/cardMedia/view.jsx @@ -18,7 +18,7 @@ class CardMedia extends React.PureComponent { } const url = thumbnail || Placeholder; - return
; + return
; } }