aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-03-04 18:38:02 +0100
committerMax Magorsch <arzano@gentoo.org>2020-03-04 18:38:02 +0100
commit18aea42c0f452a2d819dee52c5988d3bc216b9ac (patch)
tree1d81bc14dcce92cdb08904c6298b85df8234e06f
parentFix 'lsat updated' in the footer (diff)
downloadplanet-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.md2
-rw-r--r--data.html.erb9
-rw-r--r--tyrian.html.erb5
3 files changed, 10 insertions, 6 deletions
diff --git a/README.md b/README.md
index 3fe58de..63385e7 100644
--- a/README.md
+++ b/README.md
@@ -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 %>