discourse/config/locales
David Taylor 5238f6788c
FEATURE: Allow hotlinked media to be blocked (#16940)
This commit introduces a new site setting: `block_hotlinked_media`. When enabled, all attempts to hotlink media (images, videos, and audio) will fail, and be replaced with a linked placeholder. Exceptions to the rule can be added via `block_hotlinked_media_exceptions`.

`download_remote_image_to_local` can be used alongside this feature. In that case, hotlinked images will be blocked immediately when the post is created, but will then be replaced with the downloaded version a few seconds later.

This implementation is purely server-side, and does not impact the composer preview.

Technically, there are two stages to this feature:

1. `PrettyText.sanitize_hotlinked_media` is called during `PrettyText.cook`, and whenever new images are introduced by Onebox. It will iterate over all src/srcset attributes in the post HTML and check if they're allowed. If not, the attributes will be removed and replaced with a `data-blocked-hotlinked-src(set)` attribute

2. In the `CookedPostProcessor`, we iterate over all `data-blocked-hotlinked-src(set)` attributes and check whether we have a downloaded version of the media. If yes, we update the src to use the downloaded version. If not, the entire media element is replaced with a placeholder. The placeholder is labelled 'external media', and is a link to the offsite media.
2022-06-07 15:23:04 +01:00
..
client.ar.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.be.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.bg.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.bs_BA.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.ca.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.cs.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.da.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.de.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.el.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.en.yml DEV: Implement "My Posts" section link for experimental sidebar (#17008) 2022-06-07 10:52:54 +08:00
client.en_GB.yml Update translations (#16378) 2022-04-05 15:28:19 +02:00
client.es.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.et.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.fa_IR.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.fi.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.fr.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.gl.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.he.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.hu.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.hy.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.id.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.it.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.ja.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.ko.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.lt.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.lv.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.nb_NO.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.nl.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.pl_PL.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.pt.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.pt_BR.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.ro.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.ru.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.sk.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.sl.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.sq.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.sr.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.sv.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.sw.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.te.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.th.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.tr_TR.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.uk.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.ur.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.vi.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.zh_CN.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
client.zh_TW.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
names.yml use more appropriate labels for chinese UI option 2021-07-27 22:47:59 +08:00
plurals.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
server.ar.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.be.yml Update translations (#16852) 2022-05-17 16:51:11 +02:00
server.bg.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.bs_BA.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.ca.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.cs.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.da.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.de.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.el.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.en.yml FEATURE: Allow hotlinked media to be blocked (#16940) 2022-06-07 15:23:04 +01:00
server.en_GB.yml Update translations (#14513) 2021-10-05 15:59:26 +02:00
server.es.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.et.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.fa_IR.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.fi.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.fr.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.gl.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.he.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.hu.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.hy.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.id.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.it.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.ja.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.ko.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.lt.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.lv.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.nb_NO.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.nl.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.pl_PL.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.pt.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.pt_BR.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.ro.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.ru.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.sk.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.sl.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.sq.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.sr.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.sv.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.sw.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.te.yml Update translations (#15210) 2021-12-07 16:19:44 +01:00
server.th.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.tr_TR.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.uk.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.ur.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.vi.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
server.zh_CN.yml Update translations (#16958) 2022-05-31 16:14:37 +02:00
server.zh_TW.yml Update translations (#16902) 2022-05-24 16:03:04 +02:00
transliterate.ar.yml Create transliterate.ar.yml (#6197) 2018-07-31 14:41:49 +10:00
transliterate.bg.yml
transliterate.de.yml
transliterate.el.yml UX: Add transliteration support for the Greek language 2019-04-25 22:49:21 +02:00
transliterate.en.yml
transliterate.ru.yml
transliterate.vi.yml