Commit graph

10 commits

Author SHA1 Message Date
painejohn
cbcc2aac6f
139: Disabled multimedia embedding
This change disables multimedia embedding:

- In comments and comments replies.
- In new submissions.
- In comment & submission preview

And it's all toggle-able via an envvar, except for the JS bits,
but I linked those to the github issue, so should be easy to find
in the future.

The way it works is:

- removes markdown image/video syntax,
  eg. `![](https://example.org/someimage.jpg)` into ``
- changes link text into anchors, eg.
  `https://example.org/someimage.jpg` into
  `[https://example.org/someimage.jpg](https://example.org/someimage.jpg)`
- removes html img/video/audio tags, eg.
  `<img href="https://example.org/someimage.jpg" />` into ``
- when embedding gifs via the giphy modal in "new submission", it will
  insert only an anchor to the gif
- when attaching an image, it will upload the image, then add only an
  anchor to the post/comment body

I tested this manually, but not sure if I got all the test cases. What I
checked was:

- create comment w/ image/video/audio media using markdown -> success
- create comment reply w/ image/video/audio media using markdown ->
  success
- create comment w/ link to img/imgur/youtube/audio -> success
- create comment w/ attachment -> success
- create comment reply w/ attachment -> success
- create comment w/ img/video tag -> success
- create comment reply w/ image/video tag -> success
- create post submission w/ image/video/media using markdown -> success
- create post submission w/ link to img/imgur/youtube/audio -> success
- create post submission w/ attachment -> success
- create post submission w/ giphy gif -> success

Also, updated the formatting page.

Co-authored-by: Ben Rog-Wilhelm <zorba-github@pavlovian.net>
2022-08-07 01:30:47 -05:00
Michael House
e63a021c61 Added mentions to the markdown preview 2022-06-06 06:09:42 -05:00
Michael House
03aa2ca48e Added spoiler extension to the marked.js markdown preview 2022-06-05 15:56:11 -05:00
Michael House
bce168c295 Added purify for html sanitization 2022-06-05 10:58:17 -05:00
Michael House
bce836bf81 First stab at resolving html entities not being rendered 2022-06-05 10:37:09 -05:00
Michael House
f3f2aa3935 Made a lot of small changes in the frontend 2022-06-04 07:48:26 -05:00
Michael House
058e50add7 Added new default text and default link thumbnails, color fixes for some buttons 2022-06-03 06:36:03 -05:00
Michael House
f3a479f991 Removed emoji feature from templates and deleted emoji images 2022-05-18 20:53:28 -05:00
faul_sname
309bf44f12 [#80] Fix XSS vulnerability
On unmodified themotte, try creating a submission with

```html
<img src="/doesnotexist.png" onerror="alert(1)" />
```

and observe that your browser opens an alert window.
2022-05-17 19:00:23 -05:00
faul_sname
e1a1277268 [#80] Split marked.js into vendor part and custom part 2022-05-17 19:00:23 -05:00