aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrhenium <re4k@re4k.info>2013-06-02 18:11:39 +0900
committerrhenium <re4k@re4k.info>2013-06-02 18:11:39 +0900
commit12db5252ddf61872411712d0992fc8b2cf82fcdd (patch)
treec3515b391eddf864adf7db6f5712a7651f34347b
parent95820bfb617b4c466f908ed6d5d68bf0b3da790b (diff)
downloadaclog-12db5252ddf61872411712d0992fc8b2cf82fcdd.tar.gz
remove invalid UTF-8 characters
-rw-r--r--app/controllers/application_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 085baf1..dfab86e 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -77,7 +77,8 @@ class ApplicationController < ActionController::Base
response.content_type = "application/xhtml+xml"
# remove invalid charactors
- response.body = response.body.gsub(/[\x0-\x8\xb\xc\xe-\x1f]/, "")
+ u = ActiveSupport::Multibyte::Unicode
+ response.body = u.tidy_bytes(response.body)
end
end
end