Skip to content

Commit

Permalink
Escape page.title (barryclark#84)
Browse files Browse the repository at this point in the history
* Escape page.title
* Move cgi_escape to assign tag
  • Loading branch information
chalkpe authored and nielsenramon committed May 17, 2017
1 parent 1703e4c commit 6db5774
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="description" content="{{ page.description }}">
<meta name="viewport" content="width=device-width, initial-scale=1">

<meta property="og:title" content="{{ page.title }}">
<meta property="og:title" content="{{ page.title | escape }}">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ page.url | absolute_url }}">
<meta property="og:description" content="{{ page.description }}">
Expand All @@ -14,7 +14,7 @@

<meta name="twitter:card" content="summary">
<meta name="twitter:url" content="{{ page.url | absolute_url }}">
<meta name="twitter:title" content="{{ page.title }}">
<meta name="twitter:title" content="{{ page.title | escape }}">
<meta name="twitter:description" content="{{ page.description }}">
<meta name="twitter:image" content="{{ site.url }}{% if page.og_image %}{{ page.og_image | asset_path }}{% else %}{% asset_path og-image.jpg %}{% endif %}">

Expand Down
2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>{{ page.title }}</h1>
</div>

<div class="article-share">
{% assign page_title = page.title | truncate '110' %}
{% assign page_title = page.title | truncate '110' | cgi_escape %}
<a href="" title="Share on Twitter" onclick="window.open('https://twitter.com/home?status={{ page_title }} - {{ page.url | absolute_url }} {% if site.social.twitter %}by @{{ site.social.twitter }}{% endif %}', 'newwindow', 'width=500, height=225'); return false;" data-turbolinks="false">
<svg enable-background="new 0 0 128 128" width="15px" version="1.1" viewBox="0 0 128 128" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="_x37__stroke"><g id="Twitter"><rect clip-rule="evenodd" fill="none" fill-rule="evenodd" height="128" width="128"/><path clip-rule="evenodd" d="M128,23.294 c-4.703,2.142-9.767,3.59-15.079,4.237c5.424-3.328,9.587-8.606,11.548-14.892c-5.079,3.082-10.691,5.324-16.687,6.526 c-4.778-5.231-11.608-8.498-19.166-8.498c-14.493,0-26.251,12.057-26.251,26.927c0,2.111,0.225,4.16,0.676,6.133 C41.217,42.601,21.871,31.892,8.91,15.582c-2.261,3.991-3.554,8.621-3.554,13.552c0,9.338,4.636,17.581,11.683,22.412 c-4.297-0.131-8.355-1.356-11.901-3.359v0.331c0,13.051,9.053,23.937,21.074,26.403c-2.201,0.632-4.523,0.948-6.92,0.948 c-1.69,0-3.343-0.162-4.944-0.478c3.343,10.694,13.035,18.483,24.53,18.691c-8.986,7.227-20.315,11.533-32.614,11.533 c-2.119,0-4.215-0.123-6.266-0.37c11.623,7.627,25.432,12.088,40.255,12.088c48.309,0,74.717-41.026,74.717-76.612 c0-1.171-0.023-2.342-0.068-3.49C120.036,33.433,124.491,28.695,128,23.294" fill-rule="evenodd" id="Twitter_1_"/></g></g></svg>
</a>
Expand Down

0 comments on commit 6db5774

Please sign in to comment.