diff options
-rw-r--r-- | app/models/incoming_message.rb | 3 | ||||
-rw-r--r-- | app/views/general/blog.rhtml | 7 | ||||
-rw-r--r-- | app/views/request/_view_html_prefix.rhtml | 2 | ||||
-rw-r--r-- | app/views/user/set_profile_about_me.rhtml | 2 | ||||
-rw-r--r-- | spec/models/incoming_message_spec.rb | 7 |
5 files changed, 13 insertions, 8 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index ae7d1201e..3d128d8cd 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -569,7 +569,8 @@ class IncomingMessage < ActiveRecord::Base text.gsub!(/(Complaints and Corporate Affairs Officer)\s+Westminster Primary Care Trust.+/ms, "\\1") # Remove WhatDoTheyKnow signup links - text.gsub!(/http:\/\/www.whatdotheyknow.com\/c\/[^\s]+/, "[WDTK login link]") + domain = MySociety::Config.get('DOMAIN') + text.gsub!(/http:\/\/#{domain}\/c\/[^\s]+/, "[WDTK login link]") # Remove Home Office survey links # e.g. http://www.whatdotheyknow.com/request/serious_crime_act_2007_section_7#incoming-12650 diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.rhtml index cbd37240e..c9387c24f 100644 --- a/app/views/general/blog.rhtml +++ b/app/views/general/blog.rhtml @@ -1,8 +1,8 @@ <% @title = "#{site_name} blog and tweets" %> <h1><%=@title %></h1> - <img src="/images/twitter.png" alt="twitter icon" valign="middle"> <a href="http://www.twitter.com/whatdotheyknow">Follow us on twitter</a> - <img src="/images/rss.png" alt="RSS icon" valign="middle"> <a href="http://www.mysociety.org/category/projects/whatdotheyknow/feed/">Subscribe to blog</a> + <img src="/images/twitter.png" alt="twitter icon" valign="middle"> <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>">Follow us on twitter</a> + <img src="/images/rss.png" alt="RSS icon" valign="middle"> <a href="<%= MySociety::Config.get('BLOG_FEED') %>">Subscribe to blog</a> <% if !@twitter_user.empty? %> <div id="twitter"> <script src="http://widgets.twimg.com/j/2/widget.js"></script> @@ -52,8 +52,5 @@ new TWTR.Widget({ </p> </div> <% end %> - <p> - <a href="http://www.mysociety.org/category/projects/whatdotheyknow/">All blog posts</a> - </p> </div> diff --git a/app/views/request/_view_html_prefix.rhtml b/app/views/request/_view_html_prefix.rhtml index f425735cd..b29830ac7 100644 --- a/app/views/request/_view_html_prefix.rhtml +++ b/app/views/request/_view_html_prefix.rhtml @@ -1,6 +1,6 @@ <div class="view_html_prefix"> <div class="view_html_logo"> - <a href="/"><img src="/images/navimg/logo-trans-small.png" alt="WhatDotheyKnow?"></a> + <a href="/"><img src="/images/navimg/logo-trans-small.png" alt="<%= site_name %>"></a> </div> <div class="view_html_download_link"> <%=link_to _("Download original attachment"), @attachment_url %> diff --git a/app/views/user/set_profile_about_me.rhtml b/app/views/user/set_profile_about_me.rhtml index af6433e89..6c1edc254 100644 --- a/app/views/user/set_profile_about_me.rhtml +++ b/app/views/user/set_profile_about_me.rhtml @@ -26,7 +26,7 @@ <%= _(' Include relevant links, such as to a campaign page, your blog or a twitter account. They will be made clickable. e.g.')%> - <a href="http://www.twitter.com/whatdotheyknow">http://www.twitter.com/whatdotheyknow</a> + <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>">http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %></a> </p> </div> diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index 5fcc534ca..ad7aa8d43 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -201,6 +201,13 @@ describe IncomingMessage, " when censoring data" do data.should == "There was a mouse called Jarlsberg, he wished that he was yellow." end + it "should apply hard-coded privacy rules to HTML files" do + domain = MySociety::Config.get('DOMAIN') + data = "http://#{domain}/c/cheese" + @im.html_mask_stuff!(data) + data.should == "[WDTK login link]" + end + it "should apply censor rules to From: addresses" do mock_mail = mock('Email object') mock_mail.stub!(:from_name_if_present).and_return("Stilton Mouse") |