Added security to the post template

Signed-off-by: Valentin Popov <valentineus@gmail.com>
This commit is contained in:
Valentin Popov 2018-04-03 21:16:44 +00:00
parent cb2aa93e08
commit 8ad20776ad

View File

@ -2,11 +2,17 @@
layout: default layout: default
--- ---
<!-- Content of the post -->
<div class="post"> <div class="post">
<h1 class="post-title">{{ page.title }}</h1> <!-- Header -->
<h1 class="post-title">
{{ page.title | smartify | strip_html | normalize_whitespace }}
</h1>
<!-- Date -->
<span class="post-date">{{ page.date | date_to_long_string }}</span> <span class="post-date">{{ page.date | date_to_long_string }}</span>
{{ content }}
<!-- Contents -->
{{ content | normalize_whitespace }}
</div> </div>
<!-- Comments on the post --> <!-- Comments on the post -->
@ -14,9 +20,9 @@ layout: default
<div id="disqus_thread"></div> <div id="disqus_thread"></div>
<script type="text/javascript" defer> <script type="text/javascript" defer>
var disqus_config = function() { var disqus_config = function() {
this.page.identifier = '{{ page.url | relative_url }}'; this.page.identifier = '{{ page.id | slugify }}';
this.page.title = '{{ page.title }}'; this.page.title = '{{ page.title | smartify | strip_html | normalize_whitespace }}';
this.page.url = '{{ page.url | absolute_url }}'; this.page.url = '{{ page.url | absolute_url | uri_escape }}';
}; };
(function() { (function() {