diff options
author | Max Magorsch <arzano@gentoo.org> | 2020-03-04 18:38:02 +0100 |
---|---|---|
committer | Max Magorsch <arzano@gentoo.org> | 2020-03-04 18:38:02 +0100 |
commit | 18aea42c0f452a2d819dee52c5988d3bc216b9ac (patch) | |
tree | 1d81bc14dcce92cdb08904c6298b85df8234e06f | |
parent | Fix 'lsat updated' in the footer (diff) | |
download | planet-tyrian-18aea42c0f452a2d819dee52c5988d3bc216b9ac.tar.gz planet-tyrian-18aea42c0f452a2d819dee52c5988d3bc216b9ac.tar.bz2 planet-tyrian-18aea42c0f452a2d819dee52c5988d3bc216b9ac.zip |
Use loofah instead of textify for sanitization
By default plot is using textify for sanitization. However,
textify seems to be dead. Furtermore textify strips out images.
That's why textify has been replaced by loofah (which is also
used by rails under the hood).
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | data.html.erb | 9 | ||||
-rw-r--r-- | tyrian.html.erb | 5 |
3 files changed, 10 insertions, 6 deletions
@@ -1 +1,3 @@ # `tyrian` - Pluto Planet Template Pack + +Please note that Loofah is required for sanitization to use this pluto template. diff --git a/data.html.erb b/data.html.erb index 5967d20..ac87b78 100644 --- a/data.html.erb +++ b/data.html.erb @@ -1,3 +1,4 @@ +<% require 'loofah' %> <html> <body> @@ -37,9 +38,9 @@ </div> <div class="text-muted" style="height:63px;overflow-y: hidden;"> <% if item.content %> - <%= textify(item.content) %> + <%= Loofah.fragment(item.content).scrub!(:prune).to_s %> <% elsif item.summary %> - <%= textify(item.summary) %> + <%= Loofah.fragment(item.content).scrub!(:prune).to_s %> <% else %> -/- <% end %> @@ -98,9 +99,9 @@ </div> <% if item.content %> - <%= textify(item.content) %> + <%= Loofah.fragment(item.content).scrub!(:prune).to_s %> <% elsif item.summary %> - <%= textify(item.summary) %> + <%= Loofah.fragment(item.summary).scrub!(:prune).to_s %> <% else %> -/- <% end %> diff --git a/tyrian.html.erb b/tyrian.html.erb index 2882618..7b510a2 100644 --- a/tyrian.html.erb +++ b/tyrian.html.erb @@ -1,3 +1,4 @@ +<% require 'loofah' %> <!DOCTYPE html> <html> <head> @@ -216,9 +217,9 @@ </div> <% if item.content %> - <%= textify(item.content) %> + <%= Loofah.fragment(item.content).scrub!(:prune).to_s %> <% elsif item.summary %> - <%= textify(item.summary) %> + <%= Loofah.fragment(item.summary).scrub!(:prune).to_s %> <% else %> -/- <% end %> |