aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-03-07 13:28:45 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-03-07 16:29:12 +1100
commit3e2b161944cc4419002831d54c6bdfcd6aa30a01 (patch)
treeffa14c2527b46a458926814b261fa4a5185f504c
parent6486a1d383d7d18f0a6d272ee4e508d1d97d9bcd (diff)
Encode parameters of Twitter link
-rw-r--r--app/views/request/_sidebar.rhtml6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml
index 94588c15b..eb11a59a0 100644
--- a/app/views/request/_sidebar.rhtml
+++ b/app/views/request/_sidebar.rhtml
@@ -31,7 +31,11 @@
<h2><%= _("Act on what you've learnt") %></h2>
<div class="act_link">
- <% tweet_link = "https://twitter.com/share?url=#{h(request.url)}&via=#{h(Configuration::twitter_username)}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %>
+ <%
+ # Cast "related" to normal string because html safe string (from rails_xss gem) and CGI::escape
+ # interact badly with ':' character. Go figure! Might go away in rails 3
+ %>
+ <% tweet_link = "https://twitter.com/share?" + {:url => request.url, :via => Configuration::twitter_username, :text => @info_request.title, :related => _('alaveteli_foi:The software that runs {{site_name}}', :site_name => site_name).to_str}.to_query %>
<% link_to tweet_link do %>
<%= image_tag "twitter-16.png", :alt => "twitter icon" %>
<% end %>