Merge pull request #2851 from VickMellon/title_encoding_cast

FIX: force encoding for title field
This commit is contained in:
Sam 2014-10-17 15:01:40 +11:00
commit cb044bb219
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ class SearchObserver < ActiveRecord::Observer
end end
def self.update_posts_index(post_id, cooked, title, category) def self.update_posts_index(post_id, cooked, title, category)
search_data = scrub_html_for_search(cooked) << " " << title search_data = scrub_html_for_search(cooked) << " " << title.dup.force_encoding('UTF-8')
search_data << " " << category if category search_data << " " << category if category
update_index('post', post_id, search_data) update_index('post', post_id, search_data)
end end