From: Vladimír Vondruš Date: Sun, 10 Dec 2017 23:39:11 +0000 (+0100) Subject: theme: properly HTML-escape all content and test the results. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=65bcfe0367f459348cf26a00215c93420906c3be;p=blog.git theme: properly HTML-escape all content and test the results. --- diff --git a/pelican-theme/templates/archives.html b/pelican-theme/templates/archives.html index bcafc4ec..41b76109 100644 --- a/pelican-theme/templates/archives.html +++ b/pelican-theme/templates/archives.html @@ -2,10 +2,10 @@ {% block head_links %} {% if articles_page and articles_page.has_previous() %} - + {% endif %} {% if articles_page and articles_page.has_next() %} - + {% endif %} {% endblock head_links %} diff --git a/pelican-theme/templates/article.html b/pelican-theme/templates/article.html index 03bcc708..49b4b221 100644 --- a/pelican-theme/templates/article.html +++ b/pelican-theme/templates/article.html @@ -1,25 +1,25 @@ {% extends "base_blog.html" %} -{% block title %}{{ article.title }} | {{ M_BLOG_NAME }}{% endblock %} +{% block title %}{{ article.title }} | {{ M_BLOG_NAME|e }}{% endblock %} {% block head %} {{- super() -}} {% if article.description %} - + {% endif %} - + - - + + {% if article.summary %} - - + + {% endif %} {% if article.cover %} - + - + {% else %} {% endif %} @@ -28,21 +28,21 @@ {% block content %} {% if article.cover %} -
+
-
+
-
{{ article.locale_date }}
+
{{ article.locale_date|e }}
{% if article.authors %} -
{% for author in article.authors %}{{ author }}{% endfor %}
+
{% for author in article.authors %}{{ author|e }}{% endfor %}
{% endif %}
{% set title = article.title.split(' — ') %} -

{{ title[0] }}

+

{{ title[0] }}

{% if title|length >= 2 %}

{{ title[1] }}

{% endif %} diff --git a/pelican-theme/templates/article_header.html b/pelican-theme/templates/article_header.html index ba5d7847..610762ad 100644 --- a/pelican-theme/templates/article_header.html +++ b/pelican-theme/templates/article_header.html @@ -1,5 +1,5 @@
-

+

{% endblock %} diff --git a/pelican-theme/templates/base.html b/pelican-theme/templates/base.html index 70042623..97a2bc06 100644 --- a/pelican-theme/templates/base.html +++ b/pelican-theme/templates/base.html @@ -3,17 +3,17 @@ {% block head %} - {% block title %}{{ SITENAME }}{% endblock title %} + {% block title %}{{ SITENAME|e }}{% endblock title %} {% for href in M_CSS_FILES %} {% endfor %} {% block head_links %} {% endblock head_links %} {% if FEED_ALL_ATOM_URL %} - + {% endif %} {% if CATEGORY_FEED_ATOM_URL and category %} - + {% endif %} {% if M_THEME_COLOR %} @@ -26,8 +26,8 @@
- {%- if M_SITE_LOGO %}{% endif -%} - {{- M_SITE_LOGO_TEXT or SITENAME -}} + {%- if M_SITE_LOGO %}{% endif -%} + {{- (M_SITE_LOGO_TEXT or SITENAME)|e -}} {% if M_LINKS_NAVBAR1 or M_LINKS_NAVBAR2 %} @@ -37,13 +37,13 @@