diff --git a/app/controllers/application.rb b/app/controllers/application.rb index b4838822..60917fa8 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -148,8 +148,10 @@ class ApplicationController < ActionController::Base @response.headers['Content-Type'] = 'text/xml; charset=UTF-8' elsif %w(tex).include?(action_name) @response.headers['Content-Type'] = 'text/plain; charset=UTF-8' - else + elsif Mime::Type.parse(@request.env["HTTP_ACCEPT"]).include?(Mime::XHTML) @response.headers['Content-Type'] = 'application/xhtml+xml; charset=UTF-8' + else + @response.headers['Content-Type'] = 'text/html; charset=UTF-8' end end @@ -191,3 +193,15 @@ class ApplicationController < ActionController::Base end end + +module Mime + # Fix HTML + #HTML = Type.new "text/html", :html, %w( application/xhtml+xml ) + HTML = Type.new "text/html", :html + + # Add XHTML + XHTML = Type.new "application/xhtml+xml", :xhtml + + # Fix xhtml lookup + LOOKUP["application/xhtml+xml"] = XHTML +end diff --git a/config/spam_patterns.txt b/config/spam_patterns.txt index 5c12addc..1a791406 100644 --- a/config/spam_patterns.txt +++ b/config/spam_patterns.txt @@ -1,11 +1,8 @@ -.*\[\/link\] -.*\[\/url\] 51wisdom acupuncturealliance acyclovir Adipex adultfriend -airline allegra ampicill anafranil @@ -13,7 +10,6 @@ atenolol attacke\.ch autocorp awardspace -blogspot\.com bravehost\.com butalbital buy cheap @@ -44,7 +40,6 @@ hold-em holdem home\s*loan hoodia -http://[A-Za-z0-9_\.]+\.cn hydrocodone I am really excited I really like your site @@ -53,7 +48,6 @@ ketoconazole lust cartoon mijneigenweblog Mortage -my homepage myspace naked netfirms\.com @@ -70,7 +64,6 @@ porn prohosting protonix rapidforum -replica ringtone rolex serotonin @@ -78,7 +71,6 @@ singtaotor slot\s*machin soma super site -texas thepussies tits Tramadol @@ -93,5 +85,3 @@ Your site is great! zoloft \.iwarp\. \.tripod\.com -\[link\= -\[url\=