diff --git a/Gemfile b/Gemfile index e4f5bdad..4ed10df6 100644 --- a/Gemfile +++ b/Gemfile @@ -17,6 +17,7 @@ gem "rubycas-client", "~>2.2.1" gem "ruby-openid", :require => "openid" gem "sqlite3" gem 'bcrypt-ruby', '~> 2.1.4' +gem 'htmlentities', '~> 4.3.0' gem "webrat", ">=0.7.0", :groups => [:cucumber, :test] gem "database_cleaner", ">=0.5.0", :groups => [:cucumber, :selenium] diff --git a/Gemfile.lock b/Gemfile.lock index a952d7a4..8b5104f8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,6 +49,7 @@ GEM hoe (2.12.0) rake (~> 0.8) hpricot (0.8.4) + htmlentities (4.3.0) httpclient (2.2.1) json (1.5.3) memory_test_fix (0.1.3) @@ -107,6 +108,7 @@ DEPENDENCIES highline (~> 1.5.0) hoe hpricot + htmlentities (~> 4.3.0) memory_test_fix (~> 0.1.3) mongrel rack (= 1.1.0) diff --git a/app/views/todos/_text_todo.rhtml b/app/views/todos/_text_todo.rhtml index 291bd60c..adc39b91 100644 --- a/app/views/todos/_text_todo.rhtml +++ b/app/views/todos/_text_todo.rhtml @@ -1,4 +1,7 @@ <% +require 'htmlentities' +htmlentities = HTMLEntities.new + todo = text_todo if (todo.starred?) @@ -8,11 +11,11 @@ else end if (todo.completed?) && todo.completed_at - result_string << "["+ t('todos.completed') +": " + format_date(todo.completed_at) + "] " + result_string << "["+ htmlentities.decode(t('todos.completed')) +": " + format_date(todo.completed_at) + "] " end if todo.due - result_string << "[" + t('todos.due') + ": " + format_date(todo.due) + "] " + result_string << "[" + htmlentities.decode(t('todos.due')) + ": " + format_date(todo.due) + "] " result_string << todo.description + " " else result_string << todo.description + " "