From 729161fb2bdc308c2bb8d90f0a9a44f3b19c92c7 Mon Sep 17 00:00:00 2001 From: francis Date: Fri, 17 Oct 2008 20:43:25 +0000 Subject: Convert PDFs to HTML also --- app/controllers/request_controller.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'app/controllers/request_controller.rb') diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 2789fed97..15e39bf59 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: request_controller.rb,v 1.124 2008-10-17 20:32:42 francis Exp $ +# $Id: request_controller.rb,v 1.125 2008-10-17 20:43:25 francis Exp $ class RequestController < ApplicationController @@ -405,13 +405,12 @@ class RequestController < ApplicationController html = @attachment.body_as_html view_html_stylesheet = render_to_string :partial => "request/view_html_stylesheet" - html.sub!("", "" + view_html_stylesheet) + html.sub!(//i, "" + view_html_stylesheet) + html.sub!(/]*>/i, '
' + view_html_stylesheet) + html.sub!(/<\/body[^>]*>/i, '
' + view_html_stylesheet) view_html_prefix = render_to_string :partial => "request/view_html_prefix" - html.sub!("", view_html_prefix + "") - - html.sub!("", '
') - html.sub!("') + html.sub!("", view_html_prefix) # Mask any more emails that have now been exposed (e.g. in PDFs - ones in # .doc will have been got in get_attachment_internal below) -- cgit v1.2.3