From a663455cf685be63d090f801f9470fca142bfc39 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Fri, 23 Jul 2010 13:21:05 +1000 Subject: [PATCH] HTML escape titles and excerpts --- layouts/_article.html | 4 ++-- layouts/_head.html | 2 +- layouts/articles.html | 2 +- layouts/default.html | 2 +- lib/default.rb | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/layouts/_article.html b/layouts/_article.html index 6595527..88b232c 100644 --- a/layouts/_article.html +++ b/layouts/_article.html @@ -6,7 +6,7 @@ <%= post_date.year %>

- <%= @article[:title] %> - <%= @article[:extra] %> + <%=h @article[:title] %> + <%=h @article[:extra] %>

diff --git a/layouts/_head.html b/layouts/_head.html index 6be075b..1faf59d 100644 --- a/layouts/_head.html +++ b/layouts/_head.html @@ -1,6 +1,6 @@ -<%= [@item[:title], 'WezM.net'].compact.join(' • ') %> +<%=h [@item[:title], 'WezM.net'].compact.join(' - ') %> diff --git a/layouts/articles.html b/layouts/articles.html index aa8769f..e7458b8 100644 --- a/layouts/articles.html +++ b/layouts/articles.html @@ -6,7 +6,7 @@ <%= render '_header' %>
-

Archives

+

<%= h(@item[:title] || 'Articles') %>

<% menu = [ diff --git a/layouts/default.html b/layouts/default.html index e672223..94ff625 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -6,7 +6,7 @@ > <%= render '_header' %> <%= render '_footer' %> diff --git a/lib/default.rb b/lib/default.rb index 07d9409..ab4f4f4 100644 --- a/lib/default.rb +++ b/lib/default.rb @@ -6,4 +6,5 @@ require 'json' include Nanoc3::Helpers::Rendering include Nanoc3::Helpers::Blogging include Nanoc3::Helpers::XMLSitemap +include Nanoc3::Helpers::HTMLEscape include WezM::Helpers::Articles